]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: assert a valid limit in xfs_rtfind_forw
authorChristoph Hellwig <hch@lst.de>
Mon, 29 Jul 2024 21:15:31 +0000 (14:15 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 30 Jul 2024 01:07:30 +0000 (18:07 -0700)
Source kernel commit: 1bad5ccef903f0b583f6101d2cff27692c139614

Protect against developers passing stupid limits when refactoring the
RT code once again.

Signed-off-by: Christoph Hellwig <hch@lst.de>
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.
         */