Commit b0bbc8a3 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba
Browse files

btrfs: check correct bio in finish_compressed_bio_read



Commit c09abff8 ("btrfs: cloned bios must not be iterated by
bio_for_each_segment_all") added ASSERT()'s to make sure we weren't
calling bio_for_each_segment_all() on a RAID5/6 bio.  However it was
checking the bio that the compression code passed in, not the
cb->orig_bio that we actually iterate over, so adjust this ASSERT() to
check the correct bio.

Reviewed-by: default avatarBoris Burkov <boris@bur.io>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 1784b7d5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -259,7 +259,7 @@ static void finish_compressed_bio_read(struct compressed_bio *cb, struct bio *bi
		 * We have verified the checksum already, set page checked so
		 * the end_io handlers know about it
		 */
		ASSERT(!bio_flagged(bio, BIO_CLONED));
		ASSERT(!bio_flagged(cb->orig_bio, BIO_CLONED));
		bio_for_each_segment_all(bvec, cb->orig_bio, iter_all) {
			u64 bvec_start = page_offset(bvec->bv_page) +
					 bvec->bv_offset;