]> www.infradead.org Git - users/hch/xfsprogs.git/commit
Merge tag 'scrub-directory-tree-6.10_2024-07-29' of https://git.kernel.org/pub/scm...
authorCarlos Maiolino <cem@kernel.org>
Tue, 6 Aug 2024 13:50:08 +0000 (15:50 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 6 Aug 2024 13:50:08 +0000 (15:50 +0200)
commitfaa07d835f5f6ed5aab6946ec8497e8cc1cf55b7
tree434273ea507e82a640485eca52c2ff30b59d9fa2
parent34052f31e3af6fb4f24b6617a09aead54de84328
parent5a30504f0c60e10dc0cecd201c5afc18083fd0ac
Merge tag 'scrub-directory-tree-6.10_2024-07-29' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfsprogs-dev into for-next

xfsprogs: detect and correct directory tree problems [v13.8 21/28]

Historically, checking the tree-ness of the directory tree structure has
not been complete.  Cycles of subdirectories break the tree properties,
as do subdirectories with multiple parents.  It's easy enough for DFS to
detect problems as long as one of the participants is reachable from the
root, but this technique cannot find unconnected cycles.

Directory parent pointers change that, because we can discover all of
these problems from a simple walk from a subdirectory towards the root.
For each child we start with, if the walk terminates without reaching
the root, we know the path is disconnected and ought to be attached to
the lost and found.  If we find ourselves, we know this is a cycle and
can delete an incoming edge.  If we find multiple paths to the root, we
know to delete an incoming edge.

Even better, once we've finished walking paths, we've identified the
good ones and know which other path(s) to remove.

This has been running on the djcloud for months with no problems.  Enjoy!

Signed-off-by: Darrick J. Wong <djwong@kernel.org>