• Darrick J. Wong's avatar
    xfs: make xfs_rtalloc_query_range input parameters const · c02f6529
    Darrick J. Wong authored
    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>
    c02f6529
xfs_rtbitmap.c 26.8 KB