]> www.infradead.org Git - nvme.git/commitdiff
xfs: assert a valid limit in xfs_rtfind_forw
authorChristoph Hellwig <hch@lst.de>
Fri, 30 Aug 2024 22:36:54 +0000 (15:36 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Sun, 1 Sep 2024 15:58:19 +0000 (08:58 -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>
fs/xfs/libxfs/xfs_rtbitmap.c

index 9feeefe539488cc46ac111956e5b35274c33a5e2..4de97c4e8ebddec5558a7bd02a8fe99cf4d7b50b 100644 (file)
@@ -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.
         */