On Sat, May 11, 2024 at 11:42:34AM -0700, Linus Torvalds wrote: > so we have another level of locking going on, and my patch only moved > the dcache pruning outside the lock of the directory we're removing > (not outside the lock of the directory that contains the removed > directory). > > And that outside lock is the much more important one, I bet. ... and _that_ is where taking d_delete outside of the lock might take an unpleasant analysis of a lot of code. We have places where we assume that holding the parent locked will prevent ->d_inode changes of children. It might be possible to get rid of that, but it will take a non-trivial amount of work. In any case, I think the original poster said that parent directories were not removed, so I doubt that rmdir() behaviour is relevant for their load.