|
|
Log in / Subscribe / Register

XFS parent pointers

XFS parent pointers

Posted May 14, 2018 21:10 UTC (Mon) by viro (subscriber, #7872)
In reply to: XFS parent pointers by Cyberax
Parent article: XFS parent pointers

Still no go - you'd need to scan all "ancestor" chains (with all the IO it would imply) and do that while the graph structure is guaranteed not to change under you. Good luck with the locking, or with DoS potential in that...


to post comments

XFS parent pointers

Posted May 14, 2018 23:16 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

Shouldn't all of the parents' dentries already be in RAM, though? Locking will be more complicated, but a parallel "rename stack locking" structure specifically for renames should suffice.

XFS parent pointers

Posted May 14, 2018 23:54 UTC (Mon) by viro (subscriber, #7872) [Link]

Why would they? You've looked up foo/bar/baz and found that oh, BTW, it also has links from a/b/c/d/e/never/been/there/whatever/the/hell/it/might/be and a dozen other directories. Each of those having a bunch of ancestors of its own, etc.

Ancestors are guaranteed to be in dcache when there's only one path from root to it... Even that takes some work to maintain in the face of open_by_handle() - fs/exportfs/expfs.c is where it's dealt with. With multiple paths, that becomes a non-starter; do you really want stat(2) capable of sucking in thousands of directories from disk, all of that - with rename/link/unlink blocked on the entire filesystem? Or doing that already joyful work on a graph that keeps changing under you...

Sure, you could pull *everything* into dcache on mount and keep it there all along. Then everything will be in dcache at all times, but that means memory footprint from hell and hash chains' lengths from the same place. And you still have a potentially enormous graph (remember, you've got everything in dcache) and need to answer questions like "will it remain a connected directed graph if we remove this edge?" and "will adding such an edge create a loop in it?", atomically wrt graph modifications...


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