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)
committerDavid Sterba <dsterba@suse.com>
Fri, 6 May 2016 13:22:49 +0000 (15:22 +0200)
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>
fs/btrfs/scrub.c

index 96d2a0de35a8b5f2446ed9fe05fb3ac71a08b4f0..d270c700ed3184faf13771f8b5c73004d267b918 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);