Re: [PATCH v3 20/21] __dentry_kill(): new locking scheme

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 07, 2025 at 08:11:43PM +0200, Max Kellermann wrote:
> On Mon, Jul 7, 2025 at 8:00 PM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> > Well, it tries to evict all non-busy dentries, along with the ones that
> > are only busy due to (non-busy) children, etc.
> 
> But why did you add code that keeps looping if a dead/killed dentry
> was found, even though there is no code to do anything with such a
> dentry?

Huh?  That dentry contributes a soon-to-be-gone reference to parent;
it's still there in the tree, but it's already in process of being
evicted.  The parent will remain busy the end of __dentry_kill().

It is *not* dead; if you want slightly distrubing metaphors, it is already
beyond resuscitation (that's what the negative refcount indicates), but
it has not finished dying yet.  DCACHE_DENTRY_KILLED in flags ==
"it's dead", and those can't be found in the tree/hash/list of aliases/etc.
Negative refcount on something found in the tree == "it's busy dying at
the moment" and parent is kept busy until that's over.

And we *want* those to be findable in the tree - think e.g. of umount.
We really don't want to progress to destroying fs-private data structures
before all dentries are disconnected from inodes, etc.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux