On Mon, 14 Apr 2025 at 08:28, Ian Kent <raven@xxxxxxxxxx> wrote: > > 1) putting the dentry on d_children when it's turned into positive > > 2) getting the dentry off d_children when it's turned into negative. > > That shouldn't be too difficult to do ... sounds like a good idea to me. I hadn't counted with parent pointers. While not actually dereferenced, they are compared on cache lookup. So if the parent is removed and a directory dentry is recreated with the same pointer the cache becomes corrupted. Keeping the parent alive while any negative child dentries remain doesn't sound too difficult, e.g. an need an additional refcount that is incremented in parent on child unlink and decremented on child reclaim. But that's more space in struct dentry and more complexity... Thanks, Miklos