Thread (13 messages) 13 messages, 3 authors, 2021-08-13

Re: [PATCH 1/3] xfs: make xfs_rtalloc_query_range input parameters const

From: "Darrick J. Wong" <djwong@kernel.org>
Date: 2021-08-12 15:07:41

On Thu, Aug 12, 2021 at 09:30:33AM +0100, Christoph Hellwig wrote:
On Wed, Aug 11, 2021 at 05:58:42PM -0700, Darrick J. Wong wrote:
quoted
From: Darrick J. Wong <djwong@kernel.org>

In commit 8ad560d2565e, we changed xfs_rtalloc_query_range to constrain
the range of bits in the realtime bitmap file that would actually be
searched.  In commit a3a374bf1889, we changed the range again
(incorrectly), leading to the fix in commit d88850bd5516, 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. :(
Heh.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
quoted
Not-fixed-by: a3a374bf1889 ("xfs: fix off-by-one error in xfs_rtalloc_query_range")
Not-fixed-by: d88850bd5516 ("xfs: fix high key handling in the rt allocator's query_range function")
Are these tags a thing now or is this just a grumpy Darrick?
Just grumpy me.  If you click on the commits in gitk you can see the
long stream of me trying to wrap his head around the weirdness of
rtbitmap. :/

Thanks for the review though. :)

--D
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help