From: Darrick J. Wong Date: Thu, 28 Apr 2022 03:11:09 +0000 (-0400) Subject: xfs_repair: fix AG header btree level comparisons X-Git-Tag: v5.16.0-rc0~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e9720d51a1e9efa6535b540f3c9ff88e95aabe9;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 Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- 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();