summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_rtbitmap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-08-31 00:36:54 +0200
committerDarrick J. Wong <djwong@kernel.org>2024-09-01 17:58:19 +0200
commit6d2db12d56a389b3e8efa236976f8dc3a8ae00f0 (patch)
treedb5628131d90072aedaa5f4c8a11615e8a0c63f6 /fs/xfs/libxfs/xfs_rtbitmap.c
parentxfs: remove the limit argument to xfs_rtfind_back (diff)
downloadlinux-6d2db12d56a389b3e8efa236976f8dc3a8ae00f0.tar.xz
linux-6d2db12d56a389b3e8efa236976f8dc3a8ae00f0.zip
xfs: assert a valid limit in xfs_rtfind_forw
Protect against developers passing stupid limits when refactoring the RT code once again. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_rtbitmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_rtbitmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
index 9feeefe53948..4de97c4e8ebd 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.c
+++ b/fs/xfs/libxfs/xfs_rtbitmap.c
@@ -315,6 +315,8 @@ xfs_rtfind_forw(
xfs_rtword_t incore;
unsigned int word; /* word number in the buffer */
+ ASSERT(start <= limit);
+
/*
* Compute and read in starting bitmap block for starting block.
*/