Sorry folks, I forgot to include the list.... ---------- Forwarded Message ---------- Content-Type: text/plain; charset="iso-8859-1" From: Charles Manning Reply-To: manningc2@actrix.gen.nz To: Luc Van Oostenryck Subject: Re: [BUG] in yaffs_unlink() Date: Wed, 27 Nov 2002 12:08:38 +1300 X-Mailer: KMail [version 1.3.1] References: <20021126213733.GA462@ralph05.pc.home> In-Reply-To: <20021126213733.GA462@ralph05.pc.home> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Status: RO X-Status: S On Wed, 27 Nov 2002 10:37, Luc Van Oostenryck wrote: > Hi, > > I've found an undiscovered bug in yaffs_unlink(): > The problem arise when CONFIG_YAFFS_DISABLE_BACKGROUND_DELETION > is defined and we unlink() the last/only (hard)link to a file, > but this file is still opened by an application > (the attached program can show this quickly). > > The problem is easy to understand: > unlink(2) call yaffs_unlink() > who call yaffs_Unlink() > who call yaffs_UnlinkWorker() > who call yaffs_UnlinkFile() > who simply delete everything related to this file: > directory entry, object header and data. > > I will look for this tomorrow (European time). > > I will appreciate if you CC any mail related to this to > my stupid email address at work: . Luc OK I had a quick look... The problem arises from changes I did to support background deletion. The background deletion mechanism is what provides the feature that allows unlink while open. Thus, it is probably not going to serve you well to disable background deletion. Is there any particular reason why you want to disable background deletion? If there is, then I can re-order things a bit to do it properly without background deletion. While looking, though, I saw something a few lines down which concerned me. The bit that says (and excuse the non-patch format) #ifdef __KERNEL__ if(in->myInode) { immediateDeletion = 1; } #endif should, I believe, read #ifdef __KERNEL__ if(!in->myInode) <<======== { immediateDeletion = 1; } #endif -- Charles ------------------------------------------------------- --------------------------------------------------------------------------------------- This mailing list is hosted by Toby Churchill open software (www.toby-churchill.org). If mailing list membership is no longer wanted you can remove yourself from the list by sending an email to yaffs-request@toby-churchill.org with the text "unsubscribe" (without the quotes) as the subject.