]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_scrub: boost the repair priority of dependencies of damaged items
authorDarrick J. Wong <djwong@kernel.org>
Mon, 29 Jul 2024 23:23:06 +0000 (16:23 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:07 +0000 (17:01 -0700)
commit317d54ea7a92148d6082c960e50f73584b735bde
tree7a0aef351cef5fda26e30fa328d749ec6f5c4e46
parentca06c565da8f37f7e04a19aa2f4090bc0aa532a4
xfs_scrub: boost the repair priority of dependencies of damaged items

In XFS, certain types of metadata objects depend on the correctness of
lower level metadata objects.  For example, directory blocks are stored
in the data fork of directory files, which means that any issues with
the inode core and the data fork should be dealt with before we try to
repair a directory.

xfs_scrub prioritises repairs by the severity of what the kernel scrub
function reports -- anything directly observed to be corrupt get
repaired first, then anything that had trouble with cross referencing,
and finally anything that was correct but could be further optimised.
Returning to the above example, if a directory data fork mapping offset
is off by a bit flip, scrub will mark that as failing cross referencing,
but it'll mark the directory as corrupt.  Repair should check out the
mapping problem before it tackles the directory.

Do this by embedding a dependency table and using it to boost the
priority of the repair_item fields as needed.

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