From 2074423c17b1e57fed18ea39d7e42b63cee67322 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 28 Apr 2022 15:39:03 -0400 Subject: [PATCH] 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 --- repair/scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); -- 2.47.2