Skip to content

Commit

Permalink
block: reset bi_iter.bi_done after splitting bio
Browse files Browse the repository at this point in the history
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: 63573e3 ("bio-integrity: Restore original iterator on verify stage")
Signed-off-by: Greg Edwards <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
g-edwards authored and axboe committed Jul 27, 2018
1 parent 17d51b1 commit 5151842
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1893,6 +1893,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);
Expand Down

0 comments on commit 5151842

Please sign in to comment.