]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Merge tag 'scrub-repair-data-deps-6.10_2024-07-29' of https://git.kernel.org/pub...
authorCarlos Maiolino <cem@kernel.org>
Tue, 6 Aug 2024 13:46:15 +0000 (15:46 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 6 Aug 2024 13:46:15 +0000 (15:46 +0200)
xfs_scrub: track data dependencies for repairs [v30.9 08/28]

Certain kinds of XFS metadata depend on the correctness of lower level
metadata.  For example, directory indexes depends on the directory data
fork, which in turn depend on the directory inode to be correct.  The
current scrub code does not strictly preserve these dependencies if it
has to defer a repair until phase 4, because phase 4 prioritizes repairs
by type (corruption, then cross referencing, and then preening) and
loses the ordering of in the previous phases.  This leads to absurd
things like trying to repair a directory before repairing its corrupted
fork, which is absurd.

To solve this problem, introduce a repair ticket structure to track all
the repairs pending for a principal object (inode, AG, etc).  This
reduces memory requirements if an object requires more than one type of
repair and makes it very easy to track the data dependencies between
sub-objects of a principal object.  Repair dependencies between object
types (e.g.  bnobt before inodes) must still be encoded statically into
phase 4.

A secondary benefit of this new ticket structure is that we can decide
to attempt a repair of an object A that was flagged for a cross
referencing error during the scan if a different object B depends on A
but only B showed definitive signs of corruption.

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

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

Trivial merge