xfs: don't cross reference rmapbt with bitmaps if they're incomplete

LOLLM points out that runtime errors (e.g. ENOMEM) when we're trying to
compute space usag bitmaps are silently dropped by the rmapbt scrubber.
We ought to flag that as an incomplete scrub instead of reporting
cross-referencing errors based on faulty data.

Cc: stable@vger.kernel.org # v6.4
Fixes: fed050f345 ("xfs: cross-reference rmap records with ag btrees")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
Darrick J. Wong 2026-09-14 22:37:36 -07:00 committed by Carlos Maiolino
parent 41c4c41cf6
commit d7b92cbe56

View File

@ -493,11 +493,18 @@ xchk_rmapbt_walk_ag_metadata(
* If there's an error, set XFAIL and disable the bitmap
* cross-referencing checks, but proceed with the scrub anyway.
*/
if (error)
xchk_btree_xref_process_error(sc, sc->sa.rmap_cur,
sc->sa.rmap_cur->bc_nlevels - 1, &error);
else
cr->bitmaps_complete = true;
if (error) {
if (!xchk_btree_xref_process_error(sc, sc->sa.rmap_cur,
sc->sa.rmap_cur->bc_nlevels - 1, &error)) {
/* only set incomplete if we didn't set xfail */
if (error)
xchk_set_incomplete(sc);
}
return 0;
}
cr->bitmaps_complete = true;
return 0;
}
@ -567,7 +574,8 @@ xchk_rmapbt(
if (error)
goto out;
xchk_rmapbt_check_bitmaps(sc, cr);
if (cr->bitmaps_complete)
xchk_rmapbt_check_bitmaps(sc, cr);
out:
xagb_bitmap_destroy(&cr->refcbt_owned);