mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
xfs: fix units conversion error in xfs_bmap_del_extent_delay
[ Upstream commit ddd98076d5c075c8a6c49d9e6e8ee12844137f23 ]
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: fa5c836ca8 ("xfs: refactor xfs_bunmapi_cow")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9153644934
commit
34167d0216
@@ -4807,7 +4807,7 @@ xfs_bmap_del_extent_delay(
|
|||||||
ASSERT(got_endoff >= del_endoff);
|
ASSERT(got_endoff >= del_endoff);
|
||||||
|
|
||||||
if (isrt) {
|
if (isrt) {
|
||||||
uint64_t rtexts = XFS_FSB_TO_B(mp, del->br_blockcount);
|
uint64_t rtexts = del->br_blockcount;
|
||||||
|
|
||||||
do_div(rtexts, mp->m_sb.sb_rextsize);
|
do_div(rtexts, mp->m_sb.sb_rextsize);
|
||||||
xfs_mod_frextents(mp, rtexts);
|
xfs_mod_frextents(mp, rtexts);
|
||||||
|
|||||||
Reference in New Issue
Block a user