]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: only check mergeability of bnobt records
authorDarrick J. Wong <djwong@kernel.org>
Mon, 27 Jul 2026 05:22:59 +0000 (22:22 -0700)
committerCarlos Maiolino <cem@kernel.org>
Mon, 3 Aug 2026 08:17:34 +0000 (10:17 +0200)
In the cntbt (free space by block count) btree, records are not supposed
to be in startblock order.  Hence the mergeability check is pointless.
Remove it, since it does nothing, as LOLLM points out.

Cc: stable@vger.kernel.org # v6.4
Fixes: d5784ae82778d9 ("xfs: flag free space btree records that could be merged")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/scrub/alloc.c

index 48edaa2cb1e0793f860b40166cd58fbed1c9fc14..c666be69f16481df27eabe92459ebbdf8e95c010 100644 (file)
@@ -136,7 +136,7 @@ xchk_allocbt_rec(
        const union xfs_btree_rec       *rec)
 {
        struct xfs_alloc_rec_incore     irec;
-       struct xchk_alloc       *ca = bs->private;
+       struct xchk_alloc               *ca = bs->private;
 
        xfs_alloc_btrec_to_irec(rec, &irec);
        if (xfs_alloc_check_irec(to_perag(bs->cur->bc_group), &irec) != NULL) {
@@ -144,7 +144,8 @@ xchk_allocbt_rec(
                return 0;
        }
 
-       xchk_allocbt_mergeable(bs, ca, &irec);
+       if (bs->sc->sm->sm_type == XFS_SCRUB_TYPE_BNOBT)
+               xchk_allocbt_mergeable(bs, ca, &irec);
        xchk_allocbt_xref(bs->sc, &irec);
 
        return 0;