[Yaffs-archive] Re: [BUG] in yaffs_unlink()

Luc Van Oostenryck luc.vanoostenryck@easynet.be
Wed, 27 Nov 2002 01:01:17 +0100


On Wed, Nov 27, 2002 at 11:52:06AM +1300, Charles Manning wrote:
> 
> The way this is supposed to work (Posix) is that if a file is open and it 
> gets unlinked, then it disappears from the directory etc but the file is 
> still there until the last handle gets closed.  These Posix people thought of 
> some very nasty things to throw at file system writes. 

This behaviour largely predate POSIX but, I think, date from the
beginning of UNIX (more than 30 years ago).
It's a necessity since you can never assume that process will cooperate:
one process can use a file and at the same time a process can remove it,
with this semantic both process can do their jobs correctly.
 
> The way I designed this to work is that when the file gets unlinked (last 
> link) it gets placed in the "unlinked directory" which is not in the 
> directory tree. It should only be marked for deletion if the file is already 
> closed (or when the file handle is closed).

Is this a necessity? What will/should happen if we just remove the file 
entry from the directory?
i.e: yaffs_unlink()     -> play with the hardlink iplementation
			 + yaffs_RemoveObjectFromDirectory()

     yaffs_delete_inode -> yaffs_DeleteWorker()
                         + yaffs_FreeTnode()
                         + yaffs_FreeObject()

?????

>                                             Something is not working properly 
> here :-(.
> 
> I thought I had tested this... damn. I will look.


	"It doesn't need to be tested, because it works."
		-- Richard Holloway

-:)
 
-- 
Luc Van Oostenryck


---------------------------------------------------------------------------------------
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.