Hi all, While I was reviewing how to integrate realtime allocation groups with the rt allocator, I noticed several bugs in the existing allocation code with regards to calculating the maximum range of rtx to scan for free space. This series fixes those range bugs and cleans up a few things too. I also added a few cleanups from Christoph. If you're going to start using this code, I strongly recommend pulling from my git trees, which are linked below. With a bit of luck, this should all go splendidly. Comments and questions are, as always, welcome. --D kernel git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=rtalloc-fixes-6.12 --- Commits in this patchset: * xfs: use the recalculated transaction reservation in xfs_growfs_rt_bmblock * xfs: ensure rtx mask/shift are correct after growfs * xfs: don't return too-short extents from xfs_rtallocate_extent_block * xfs: don't scan off the end of the rt volume in xfs_rtallocate_extent_block * xfs: refactor aligning bestlen to prod * xfs: clean up xfs_rtallocate_extent_exact a bit * xfs: reduce excessive clamping of maxlen in xfs_rtallocate_extent_near * xfs: fix broken variable-sized allocation detection in xfs_rtallocate_extent_block * xfs: remove xfs_rtb_to_rtxrem * xfs: simplify xfs_rtalloc_query_range --- fs/xfs/libxfs/xfs_rtbitmap.c | 51 ++++++--------- fs/xfs/libxfs/xfs_rtbitmap.h | 21 ------ fs/xfs/libxfs/xfs_sb.c | 12 +++ fs/xfs/libxfs/xfs_sb.h | 2 + fs/xfs/xfs_discard.c | 15 ++-- fs/xfs/xfs_fsmap.c | 11 +-- fs/xfs/xfs_rtalloc.c | 145 +++++++++++++++++++++++------------------- 7 files changed, 124 insertions(+), 133 deletions(-)