Skip to content

Commit 1045844

Browse files
Darrick J. Wonggregkh
authored andcommitted
xfs: grab rtrmap btree when checking rgsuper
commit ea6e2d9 upstream. LOLLM noticed that we aren't grabbing the rtrmap btree when we check the realtime group superblock. As a result, none of the cross-referencing checks have ever run. Fix this. Cc: stable@vger.kernel.org # v6.14 Fixes: 428e488 ("xfs: allow queued realtime intents to drain before scrubbing") 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d1c4c40 commit 1045844

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

fs/xfs/scrub/rgsuper.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ int
2323
xchk_setup_rgsuperblock(
2424
struct xfs_scrub *sc)
2525
{
26+
if (xchk_need_intent_drain(sc))
27+
xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN);
2628
return xchk_trans_alloc(sc, 0);
2729
}
2830

@@ -43,6 +45,7 @@ xchk_rgsuperblock(
4345
struct xfs_scrub *sc)
4446
{
4547
xfs_rgnumber_t rgno = sc->sm->sm_agno;
48+
unsigned int flags;
4649
int error;
4750

4851
/*
@@ -63,7 +66,12 @@ xchk_rgsuperblock(
6366
if (!xchk_xref_process_error(sc, 0, 0, &error))
6467
return error;
6568

66-
error = xchk_rtgroup_lock(sc, &sc->sr, XFS_RTGLOCK_BITMAP_SHARED);
69+
if (xfs_has_rtrmapbt(sc->mp))
70+
flags = XFS_RTGLOCK_BITMAP | XFS_RTGLOCK_RMAP;
71+
else
72+
flags = XFS_RTGLOCK_BITMAP_SHARED;
73+
74+
error = xchk_rtgroup_lock(sc, &sc->sr, flags);
6775
if (error)
6876
return error;
6977

0 commit comments

Comments
 (0)