Skip to content

Commit d898137

Browse files
author
Darrick J. Wong
committed
xfs: fix getfsmap reporting past the last rt extent
The realtime section ends at the last rt extent. If the user configures the rt geometry with an extent size that is not an integer factor of the number of rt blocks, it's possible for there to be rt blocks past the end of the last rt extent. These tail blocks cannot ever be allocated and will cause corruption reports if the last extent coincides with the end of an rt bitmap block, so do not report consider them for the GETFSMAP output. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
1 parent 7975aba commit d898137

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/xfs_fsmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ __xfs_getfsmap_rtdev(
529529
uint64_t eofs;
530530
int error = 0;
531531

532-
eofs = XFS_FSB_TO_BB(mp, mp->m_sb.sb_rblocks);
532+
eofs = XFS_FSB_TO_BB(mp, mp->m_sb.sb_rextents * mp->m_sb.sb_rextsize);
533533
if (keys[0].fmr_physical >= eofs)
534534
return 0;
535535
start_rtb = XFS_BB_TO_FSBT(mp,

0 commit comments

Comments
 (0)