[lkml]   [2001]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread

On Wed, 10 Jan 2001, Andrea Arcangeli wrote:

> > Do we have enough protection to ensure this for other filesystems?
> Note that this has nothing to do with `rmdir .`. You will run into the
> mentioned issue just now with '''rmdir "`pwd`"'''. I've not checked
> the other fses but I would put such support into the VFS rather than in ext2
> (vfs can do that for you, if you do that the lowlevel fs will never get a
> readdir for a delete dentry).

That's precisely what I've already done. grep for IS_DEADDIR() and notice
that it's only checked under ->i_zombie. Both rmdir() and rename() hold
it on victim, readdir() holds it on directory it wants to read and everything
that creates or removes objects holds it on parent. Successful rmdir()
and rename()-over-directory set S_DEAD in the ->i_flags before dropping

The only thing that can happen with the dead directory is ->lookup().

IOW, in 2.4 most of filesystems had dropped the -EBUSY on rmdir() they
used to have. And ext2 got rid of the special handling of dead directories -
these checks are done in VFS now. The only fs with special treatment of
rmdir()/rename() wrt busy victims is NFS, IIRC.

Filesystems still can refuse to remove busy directories (same test as in
2.2) but there's almost no reasons for that.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.061 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site