]> git.hungrycats.org Git - linux/commitdiff
btrfs: Fix BUG_ON condition in scrub_setup_recheck_block()
authorAshish Samant <ashish.samant@oracle.com>
Sat, 30 Apr 2016 01:33:59 +0000 (18:33 -0700)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Wed, 17 Aug 2016 02:42:16 +0000 (22:42 -0400)
pagev array in scrub_block{} is of size SCRUB_MAX_PAGES_PER_BLOCK.
page_index should be checked with the same to trigger BUG_ON().

Signed-off-by: Ashish Samant <ashish.samant@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
(cherry picked from commit 2473114981a36b4f0f57cf6e9548037d547a71b7)

fs/btrfs/scrub.c

index f02f38265535e5de995f1bb6357461c2f1d3fc8b..c63442d36667a6b267df078fbf8bc14360556f56 100644 (file)
@@ -1350,7 +1350,7 @@ static int scrub_setup_recheck_block(struct scrub_block *original_sblock,
                recover->bbio = bbio;
                recover->map_length = mapped_length;
 
-               BUG_ON(page_index >= SCRUB_PAGES_PER_RD_BIO);
+               BUG_ON(page_index >= SCRUB_MAX_PAGES_PER_BLOCK);
 
                nmirrors = min(scrub_nr_raid_mirrors(bbio), BTRFS_MAX_MIRRORS);