On Wed, Jun 11, 2025 at 11:00:06AM +1000, NeilBrown wrote: > Yes. > > > > > Where does your dentry lock nest wrt ->i_rwsem? As a bonus (well, malus, I guess) > > question, where does it nest wrt parent *and* child inodes' ->i_rwsem for rmdir > > and rename? > > Between inode of parent of the dentry and inode of the dentry. That's... going to be fun to prove the deadlock avoidance. Looking forward to such proof... Look, the reason why I'm sceptical is that we had quite a few interesting problems with directory locking schemes; fun scenarios are easy to miss and I've fucked up more than a few times in that area. Fixing it afterwards can be a real bitch, especially if we get filesystem-specific parts in the picture. So let's sort it out _before_ we go there. And I mean proof - verifiable statements about the functions, etc. Incidentally, what was the problem with having dentry locked before the parent? At least that way we would have a reasonable lock ordering... It would require some preliminary work, but last time I looked at the area (not very deeply) it felt like a plausible direction... I wonder which obstacle have I missed...