]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs_scrub: detect and repair directory tree corruptions
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Jul 2024 21:21:28 +0000 (14:21 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 1 Aug 2024 00:06:24 +0000 (17:06 -0700)
commitc46a1ef93a1bccab29261abb12a0d0c31a3bb4e1
tree6d8fb14183091d0a564a522e50bd5c212f807bb8
parent446379ec47f2dfcf8e8067fdbdf71fc822d37cfc
xfs_scrub: detect and repair directory tree corruptions

Now that we have online fsck for directory tree structure problems, we
need to find a place to call it.  The scanner requires that parent
pointers are enabled, that directory link counts are correct, and that
every directory entry has a corresponding parent pointer.  Therefore, we
can only run it after phase 4 fixes every file, and phase 5 resets the
link counts.

In other words, we call it as part of the phase 5 file scan that we do
to warn about weird looking file names.  This has the added benefit that
opening the directory by handle is less likely to fail if there are
loops in the directory structure.  For now, only plumb in enough to try
to fix directory tree problems right away; the next patch will make
phase 5 retry the dirloop scanner until the problems are fixed or we
stop making forward progress.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/phase5.c