From: Christoph Hellwig Date: Thu, 9 Nov 2023 16:02:33 +0000 (+0100) Subject: repair: fix the call to search_rt_dup_extent in scan_bmapbt X-Git-Tag: v6.6.0~52 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3bd45ce1ceb74cfae826fabeea991adc7c3d8ede;p=xfsprogs-dev.git repair: fix the call to search_rt_dup_extent in scan_bmapbt search_rt_dup_extent expects an RT extent number and not a fsbno. Convert the units before the call. Without this we are unlikely to ever found a legit duplicate extent on the RT subvolume because the search will always be off the end. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" Signed-off-by: Carlos Maiolino --- diff --git a/repair/scan.c b/repair/scan.c index 27a33286a..7a0587615 100644 --- a/repair/scan.c +++ b/repair/scan.c @@ -402,8 +402,10 @@ _("bad state %d, inode %" PRIu64 " bmap block 0x%" PRIx64 "\n"), XFS_FSB_TO_AGBNO(mp, bno) + 1)) return(1); } else { - if (search_rt_dup_extent(mp, bno)) - return(1); + xfs_rtblock_t ext = bno / mp->m_sb.sb_rextsize; + + if (search_rt_dup_extent(mp, ext)) + return 1; } } (*tot)++;