Re: rmdir(".") works, and causes havoc

Darren Reed (darrenr@cyber.com.au)
Tue, 5 Aug 1997 13:25:55 +1000 (EST)


In some mail I received from Bill Hawes, sie wrote
>
> Linus Torvalds wrote:
> > No, it's not really a religious issue at all, it's just that the new
> > dcache code is so different from what any other unix does. And I haven't
> > checked all the small details (some of the ones you mention I knew about,
> > others were a nasty surprise that I hadn't thought about).
>
> The rmdir(".") case reminds me of an anomaly I noticed recently. If you
> mount a directory on top of your current directory, the results are,
> well, very interesting. ls will show files that used to be there, and ls
> -l will show the names of the files, but complain. Unless a file in the
> old (covered up) directory has the same name as a file in the new
> directory ...
>
> Anyway, it's rather confusing and unexpected. Shouldn't such mounts
> either be prohibited, or else the dentries of the covered up directories
> hidden away until uncovered again?

Some commercial operating systems will not allow you to mount a filesystem
onto a directory which itself (or a subdirectory or a file therein) is
open. Is the current `feature' bad enough to need changes to prevent it
from happening ? (it can be annoying at times, so long as you don't
expect some things to work).

Darren