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

Commit b8088c52 authored by Greg Edwards's avatar Greg Edwards Committed by Greg Kroah-Hartman
Browse files

block: reset bi_iter.bi_done after splitting bio



commit 5151842b9d8732d4cbfa8400b40bff894f501b2f upstream.

After the bio has been updated to represent the remaining sectors, reset
bi_done so bio_rewind_iter() does not rewind further than it should.

This resolves a bio_integrity_process() failure on reads where the
original request was split.

Fixes: 63573e35 ("bio-integrity: Restore original iterator on verify stage")
Signed-off-by: default avatarGreg Edwards <gedwards@ddn.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cc5d7097
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1889,6 +1889,7 @@ struct bio *bio_split(struct bio *bio, int sectors,
		bio_integrity_trim(split);

	bio_advance(bio, split->bi_iter.bi_size);
	bio->bi_iter.bi_done = 0;

	if (bio_flagged(bio, BIO_TRACE_COMPLETION))
		bio_set_flag(split, BIO_TRACE_COMPLETION);