On Sun, 12 May 2024 at 12:59, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > > So the children are already unreachable through that name, and can > only be reached through somebody who still has the directory open. And > I do not see how "rmdir()" can *possibly* have any valid semantic > effect on any user that has that directory as its PWD, so I claim that > the dentries that exist at this point must already not be relevant > from a semantic standpoint. Side note: our IS_DEADDIR() checks seem a bit inconsistent. That's actually what should catch some of the "I'm an a directory that has been removed", but we have that check in lookup_open(), in lookup_one_qstr_excl(), and in __lookup_slow(). I wonder if we should check it in lookup_dcache() too? Because yes, that's a difference that rmdir makes, in how it sets S_DEAD, and this seems to be an area where existing cached dentries are handled differently. Linus