Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24731149 authored by Ashish Samant's avatar Ashish Samant Committed by David Sterba
Browse files

btrfs: Fix BUG_ON condition in scrub_setup_recheck_block()



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: default avatarAshish Samant <ashish.samant@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent e042d1ec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);