]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: fix off-by-one error in xfs_rtalloc_query_range
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 5 Jul 2018 20:16:04 +0000 (15:16 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 5 Jul 2018 20:16:04 +0000 (15:16 -0500)
commita4b61d98d4deef0c7cad6c0f349cf68935ee4055
tree9ff41ebad71a4e2c537eaa75d6260fceeadfa61b
parent5b5015975b93ff50e042217e2e51614780ebcb87
xfs: fix off-by-one error in xfs_rtalloc_query_range

Source kernel commit: a3a374bf1889b1b401b25e6aada3ca4151a99d15

In commit 8ad560d2565e6 ("xfs: strengthen rtalloc query range checks")
we strengthened the input parameter checks in the rtbitmap range query
function, but introduced an off-by-one error in the process.  The call
to xfs_rtfind_forw deals with the high key being rextents, but we clamp
the high key to rextents - 1.  This causes the returned results to stop
one block short of the end of the rtdev, which is incorrect.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_rtbitmap.c