Skip to content

Commit ddd9807

Browse files
author
Darrick J. Wong
committed
xfs: fix units conversion error in xfs_bmap_del_extent_delay
The unit conversions in this function do not make sense. First we convert a block count to bytes, then divide that bytes value by rextsize, which is in blocks, to get an rt extent count. You can't divide bytes by blocks to get a (possibly multiblock) extent value. Fortunately nobody uses delalloc on the rt volume so this hasn't mattered. Fixes: fa5c836 ("xfs: refactor xfs_bunmapi_cow") Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent c2988eb commit ddd9807

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4827,7 +4827,7 @@ xfs_bmap_del_extent_delay(
48274827
ASSERT(got_endoff >= del_endoff);
48284828

48294829
if (isrt) {
4830-
uint64_t rtexts = XFS_FSB_TO_B(mp, del->br_blockcount);
4830+
uint64_t rtexts = del->br_blockcount;
48314831

48324832
do_div(rtexts, mp->m_sb.sb_rextsize);
48334833
xfs_mod_frextents(mp, rtexts);

0 commit comments

Comments
 (0)