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

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

From: Christoph Hellwig <hch@infradead.org>
Date: 2021-08-12 08:32:57

On Wed, Aug 11, 2021 at 05:58:42PM -0700, Darrick J. Wong wrote:
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>
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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help