From: Darrick J. Wong Date: Thu, 6 Jan 2022 22:13:21 +0000 (-0800) Subject: xfs_repair: fix AG header btree level comparisons X-Git-Tag: libxfs-5.16-sync_2022-03-17~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c219a0b778be1f240fbe8e7be143d78621d7d2d6;p=thirdparty%2Fxfsprogs-dev.git xfs_repair: fix AG header btree level comparisons It's not an error if repair encounters a btree with the maximal height, so don't print warnings. Also, we don't allow zero-height btrees. Signed-off-by: Darrick J. Wong --- diff --git a/repair/scan.c b/repair/scan.c index 909c4494c..e2d281a21 100644 --- a/repair/scan.c +++ b/repair/scan.c @@ -2297,7 +2297,7 @@ validate_agf( priv.nr_blocks = 0; levels = be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]); - if (levels >= XFS_BTREE_MAXLEVELS) { + if (levels == 0 || levels > XFS_BTREE_MAXLEVELS) { do_warn(_("bad levels %u for rmapbt root, agno %d\n"), levels, agno); rmap_avoid_check(); @@ -2323,7 +2323,7 @@ validate_agf( unsigned int levels; levels = be32_to_cpu(agf->agf_refcount_level); - if (levels >= XFS_BTREE_MAXLEVELS) { + if (levels == 0 || levels > XFS_BTREE_MAXLEVELS) { do_warn(_("bad levels %u for refcountbt root, agno %d\n"), levels, agno); refcount_avoid_check();