From 576c2fe09e498732081c597ecb9527fdb583a7df Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 11 Jul 2024 06:43:37 +0200 Subject: [PATCH] repair: make RT-specific code in {rmap,refcount}_avoid_check Now that we're not allocation the bitmaps for non-rtgroups file systems, don't touch them here either. Signed-off-by: Christoph Hellwig --- repair/rmap.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/repair/rmap.c b/repair/rmap.c index 88589f7cb..5015d121e 100644 --- a/repair/rmap.c +++ b/repair/rmap.c @@ -1405,13 +1405,15 @@ rmap_avoid_check( struct xfs_rtgroup *rtg; xfs_rgnumber_t rgno; - for_each_rtgroup(mp, rgno, rtg) { - struct xfs_ag_rmap *ar = rmaps_for_group(true, rtg->rtg_rgno); + if (xfs_has_rtgroups(mp)) { + for_each_rtgroup(mp, rgno, rtg) { + struct xfs_ag_rmap *ar = rmaps_for_group(true, rtg->rtg_rgno); - ar->rg_rmap_ino = NULLFSINO; - } + ar->rg_rmap_ino = NULLFSINO; + } - bitmap_clear(rmap_inodes, 0, XFS_MAXINUMBER); + bitmap_clear(rmap_inodes, 0, XFS_MAXINUMBER); + } rmapbt_suspect = true; } @@ -1992,13 +1994,15 @@ refcount_avoid_check( struct xfs_rtgroup *rtg; xfs_rgnumber_t rgno; - for_each_rtgroup(mp, rgno, rtg) { - struct xfs_ag_rmap *ar = rmaps_for_group(true, rtg->rtg_rgno); + if (xfs_has_rtgroups(mp)) { + for_each_rtgroup(mp, rgno, rtg) { + struct xfs_ag_rmap *ar = rmaps_for_group(true, rtg->rtg_rgno); - ar->rg_refcount_ino = NULLFSINO; - } + ar->rg_refcount_ino = NULLFSINO; + } - bitmap_clear(refcount_inodes, 0, XFS_MAXINUMBER); + bitmap_clear(refcount_inodes, 0, XFS_MAXINUMBER); + } refcbt_suspect = true; } -- 2.50.1