]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: assert a valid limit in xfs_rtfind_forw
authorChristoph Hellwig <hch@lst.de>
Tue, 30 Jul 2024 18:17:09 +0000 (11:17 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 1 Aug 2024 00:07:32 +0000 (17:07 -0700)
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

index c7613f2de7b0a07245a1a35c1016a412b112f3f0..f578b0d34b36d3425b56c42b2c476431f91c6a8b 100644 (file)
@@ -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.
         */