]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: fix off-by-one error when calling xchk_xref_has_rt_owner
authorDarrick J. Wong <djwong@kernel.org>
Tue, 14 Jul 2026 06:06:28 +0000 (23:06 -0700)
committerCarlos Maiolino <cem@kernel.org>
Tue, 14 Jul 2026 09:01:47 +0000 (11:01 +0200)
LOLLM noticed an off-by-one error when computing the length of the
rtrmap to cross-check.

Cc: stable@vger.kernel.org # v6.14
Fixes: 037a44d8277adf ("xfs: cross-reference the realtime rmapbt")
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/rtbitmap.c

index de3f22f310f7ebfb7eeb63b8797d8cf1c9b46d30..52c24d3d4be6ce07d516278909fe69af42160abf 100644 (file)
@@ -258,7 +258,7 @@ xchk_rtbitmap(
         * the last free extent we saw and the last possible extent in the rt
         * group.
         */
-       last_rgbno = rtg->rtg_extents * mp->m_sb.sb_rextsize - 1;
+       last_rgbno = rtg->rtg_extents * mp->m_sb.sb_rextsize;
        if (rtb->next_free_rgbno < last_rgbno)
                xchk_xref_has_rt_owner(sc, rtb->next_free_rgbno,
                                last_rgbno - rtb->next_free_rgbno);