[lkml]   [1999]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: rmdir of a busy directory

On Thu, 11 Feb 1999, Alan Curry wrote:

> For as long as I can remember, if you removed a directory which is the
> current working directory of a process (for example, a shell), and then tried
> to do anything with that process that accesses the current working directory
> (for example, type "ls"), you'd get a ENOENT.
> Under 2.2, though, the opendir(".") succeeds and creates the appearance of an
> empty directory. Even stranger, attempts to creat() or mkdir() in the
> nonexistent directory yield EPERM.
EPERM is absolutely reasonable - it's a pseudo-directory, it
doesn't exist on a disk anymore and nothing can be created there (nowhere
to create). Think of it as an analog of revoke() results. Returning ENOENT
on readdir() doesn't make much sense. ENOENT on opendir()? Maybe. That's
not hard to implement. Actually we need a generic mechanism to revoke
access to directory - that would take care of rmdir() on busy directory on
all filesystems. I'll look at it.

> Is this now the expected behavior, or was there an accident in last-minute
> rmdir() changes?

Mix of both. It's correct behaviour, but it was an ad-hocery.

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:50    [W:0.064 / U:3.408 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site