]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: fix off-by-one error in xfs_rtalloc_query_range
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 22 Jun 2018 06:26:58 +0000 (23:26 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Sun, 24 Jun 2018 18:56:36 +0000 (11:56 -0700)
commit09c6db55fdb727c8cbe870f5b6642bacb21f9a94
treefcc3f1b4f93b9a70f60a89f046ca431fccec1ffe
parent9249b2e0b1ea35b49d956053692b69d6a4f732e5
xfs: fix off-by-one error in xfs_rtalloc_query_range

In commit 6791a04e4bf2e ("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>
fs/xfs/libxfs/xfs_rtbitmap.c