]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: fix 32-bit truncation in xfs_compute_rextslog
authorDarrick J. Wong <djwong@kernel.org>
Wed, 27 Mar 2024 00:12:18 +0000 (17:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:28:47 +0000 (15:28 +0200)
commit89e511a745be66c2a232cb7858ac0246dc95de2d
treec081cb7d6ade8de67ea4262a15c70abcdcf138df
parent0a31f1e8d8c61e0f85307f0207ac4128ddca8910
xfs: fix 32-bit truncation in xfs_compute_rextslog

commit cf8f0e6c1429be7652869059ea44696b72d5b726 upstream.

It's quite reasonable that some customer somewhere will want to
configure a realtime volume with more than 2^32 extents.  If they try to
do this, the highbit32() call will truncate the upper bits of the
xfs_rtbxlen_t and produce the wrong value for rextslog.  This in turn
causes the rsumlevels to be wrong, which results in a realtime summary
file that is the wrong length.  Fix that.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/libxfs/xfs_rtbitmap.c