Skip to content
Commit c02f6529 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: make xfs_rtalloc_query_range input parameters const



In commit 8ad560d2, we changed xfs_rtalloc_query_range to constrain
the range of bits in the realtime bitmap file that would actually be
searched.  In commit a3a374bf, we changed the range again
(incorrectly), leading to the fix in commit d88850bd, which finally
corrected the range check code.  Unfortunately, the author never noticed
that the function modifies its input parameters, which is a totaly no-no
since none of the other range query functions change their input
parameters.

So, fix this function yet again to stash the upper end of the query
range (i.e. the high key) in a local variable and hope this is the last
time I have to fix my own function.  While we're at it, mark the key
inputs const so nobody makes this mistake again. :(

Fixes: 8ad560d2 ("xfs: strengthen rtalloc query range checks")
Not-fixed-by: a3a374bf ("xfs: fix off-by-one error in xfs_rtalloc_query_range")
Not-fixed-by: d88850bd ("xfs: fix high key handling in the rt allocator's query_range function")
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarChandan Babu R <chandanrlinux@gmail.com>
parent 21b4ee70
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment