diff mbox series

[10/41] xfs: assert a valid limit in xfs_rtfind_forw

Message ID 173041566073.962545.18309774070518861945.stgit@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series [01/41] libxfs: require -std=gnu11 for compilation by default | expand

Commit Message

Darrick J. Wong Oct. 31, 2024, 11:11 p.m. UTC
From: Christoph Hellwig <hch@lst.de>

Source kernel commit: 6d2db12d56a389b3e8efa236976f8dc3a8ae00f0

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>
---
 libxfs/xfs_rtbitmap.c |    2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c
index c7613f2de7b0a0..f578b0d34b36d3 100644
--- a/libxfs/xfs_rtbitmap.c
+++ b/libxfs/xfs_rtbitmap.c
@@ -313,6 +313,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.
 	 */