]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_repair: checking rt free space metadata must happen during phase 4
authorDarrick J. Wong <djwong@kernel.org>
Tue, 29 Oct 2024 00:03:33 +0000 (17:03 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 31 Oct 2024 22:45:05 +0000 (15:45 -0700)
commit9e63cdfd416a1de793272b5e8c6d3f286675837c
tree582e60b026e2817f46a2897a73b9f78d30916637
parent5e8139658b798d931079404660273840432bcd9f
xfs_repair: checking rt free space metadata must happen during phase 4

Back in the really old days, xfs_repair would generate the new free
space information for the realtime section during phase 5, and write the
contents to the rtbitmap and summary files during phase 6.  This was ok
because the incore information isn't used until phase 6.

Then I changed the behavior to check the generated information against
what was on disk and complain about the discrepancies.  Unfortunately,
there was a subtle flaw here -- for a non -n run, we'll have regenerated
the AG metadata before we actually check the rt free space information.
If the AG btree regeneration should clobber one of the old rtbitmap or
summary blocks, this will be reported as a corruption even though
nothing's wrong.

Move check_rtmetadata to the end of phase 4 so that this doesn't happen.

Cc: <linux-xfs@vger.kernel.org> # v5.19.0
Fixes: f2e388616d7491 ("xfs_repair: check free rt extent count")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
repair/phase4.c
repair/phase5.c
repair/xfs_repair.c