Re: `rmdir .` doesn't work in 2.4

Stephen C. Tweedie
2001-01-10T14:50:56Z

Hi,

On Tue, Jan 09, 2001 at 03:06:35PM +0100, Andrea Arcangeli wrote:
> On Tue, Jan 09, 2001 at 07:41:21AM -0600, Jesse Pollard wrote:
> > Not exactly valid, since a file could be created in that "pinned" directory
> > after the rmdir...
>
> In 2.2.x no file can be created in the pinned directory after the rmdir.

In 2.2, at least some of that protection was in ext2 itself. POSIX
mandates that a deleted directory has no dirents, so readdir() must
not return even "." or "..". ext2 achieved this by truncating the dir
to size==0, and by refusing to add dirents to the resulting completely
empty directory.

Do we have enough protection to ensure this for other filesystems?

--Stephen