summaryrefslogtreecommitdiff
path: root/kernel/debug
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-08-17 09:33:53 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-11-09 19:07:53 -0800
commit6a290d47a9f43d280653ab646eb9b600f459bff0 (patch)
tree93bdae0585e8716f4c4b8a86720792366ed05178 /kernel/debug
parentbafa814bb7d6b99822b434bd4bc9ed7360ed2d32 (diff)
xfs: make sure maxlen is still congruent with prod when rounding down
In commit 2a6ca4baed62, we tried to fix an overflow problem in the realtime allocator that was caused by an overly large maxlen value causing xfs_rtcheck_range to run off the end of the realtime bitmap. Unfortunately, there is a subtle bug here -- maxlen (and minlen) both have to be aligned with @prod, but @prod can be larger than 1 if the user has set an extent size hint on the file, and that extent size hint is larger than the realtime extent size. If the rt free space extents are not aligned to this file's extszhint because other files without extent size hints allocated space (or the number of rt extents is similarly not aligned), then it's possible that maxlen after clamping to sb_rextents will no longer be aligned to prod. The allocation will succeed just fine, but we still trip the assertion. Fix the problem by reducing maxlen by any misalignment with prod. While we're at it, split the assertions into two so that we can tell which value had the bad alignment. Fixes: 2a6ca4baed62 ("xfs: make sure the rt allocator doesn't run off the end") Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'kernel/debug')
0 files changed, 0 insertions, 0 deletions