|
|
Log in / Subscribe / Register

Why list negative children?

Why list negative children?

Posted Jul 4, 2026 22:27 UTC (Sat) by neilbrown (subscriber, #359)
In reply to: Why list negative children? by willy
Parent article: Limiting negative dentries

> When you rm a directory, you can delete all its negative dentry children too

Yes, that is a slight advantage of listing the negative children, but is it worth the cost?

I imagine that the sibling linkage would be used to keep negative dentries on a per-superblock list which allows them to be purged at unmount time. This could also serve as an lru list which might be purged more proactively.
Most of the dentries on this list are uninteresting, but we cannot be sure which. Certainly the children of a deleted parent are definitely uninteresting so the proactive purge would get rid of them more forcefully, but do we need more than that.

I can imagine removing a directory tree might create a great many negative dentries which might tip the balance. We could get an approximate count of these based on the remaining refcount on a directory when it is deleted, and use that to expedite the purge.

Or we could possibly keep the negative-children chain in the directory inode, possibly unioned with i_devices and i_linklen.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds