]> www.infradead.org Git - users/hch/xfs.git/commit
xfs: don't scan off the end of the rt volume in xfs_rtallocate_extent_block
authorDarrick J. Wong <djwong@kernel.org>
Fri, 30 Aug 2024 22:37:03 +0000 (15:37 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Sun, 1 Sep 2024 15:58:19 +0000 (08:58 -0700)
commite99aa0401eb4d3b0ce67cc8a9b98595958b0d038
tree31789c25e76587d2215a8c67c70c53774d9f081f
parentcb59233e823727ed257a9b400037082718107c06
xfs: don't scan off the end of the rt volume in xfs_rtallocate_extent_block

The loop conditional here is not quite correct because an rtbitmap block
can represent rtextents beyond the end of the rt volume.  There's no way
that it makes sense to scan for free space beyond EOFS, so don't do it.
This overrun has been present since v2.6.0.

Also fix the type of bestlen, which was incorrectly converted.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_rtalloc.c