]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: fix units conversion error in xfs_bmap_del_extent_delay
authorDarrick J. Wong <djwong@kernel.org>
Mon, 12 Feb 2024 14:02:05 +0000 (15:02 +0100)
committerCarlos Maiolino <cem@kernel.org>
Thu, 15 Feb 2024 11:56:43 +0000 (12:56 +0100)
commit06d168b5b9a2cb78af19a3e9b92e19d1df501ce8
treeb4364bac696d90da49bd3ce76361e465aeedf590
parent4dbd576217a6104920a631860b31b821256a8a18
xfs: fix units conversion error in xfs_bmap_del_extent_delay

Source kernel 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: fa5c836ca8eb5 ("xfs: refactor xfs_bunmapi_cow")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_bmap.c