From: Darrick J. Wong Date: Thu, 28 Apr 2022 19:39:03 +0000 (-0400) Subject: xfs_repair: stop using XFS_BTREE_MAXLEVELS X-Git-Tag: v5.16.0-rc0~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2074423c17b1e57fed18ea39d7e42b63cee67322;p=thirdparty%2Fxfsprogs-dev.git xfs_repair: stop using XFS_BTREE_MAXLEVELS Use the precomputed per-btree-type max height values. [sandeen: note that >= changes to > here; The maximal value is fine, but with the precomputed value specific to this filesystem, our new limit is the actual acceptable max, vs. XFS_BTREE_MAXLEVELS which was an absolute design max and was larger than most filesystems could create.] 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 e2d281a21..4a234dedc 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 == 0 || levels > XFS_BTREE_MAXLEVELS) { + if (levels == 0 || levels > mp->m_rmap_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 == 0 || levels > XFS_BTREE_MAXLEVELS) { + if (levels == 0 || levels > mp->m_refc_maxlevels) { do_warn(_("bad levels %u for refcountbt root, agno %d\n"), levels, agno); refcount_avoid_check();