Skip to content

Commit 5151842

Browse files
g-edwardsaxboe
authored andcommitted
block: reset bi_iter.bi_done after splitting bio
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]>
1 parent 17d51b1 commit 5151842

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

block/bio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,6 +1893,7 @@ struct bio *bio_split(struct bio *bio, int sectors,
18931893
bio_integrity_trim(split);
18941894

18951895
bio_advance(bio, split->bi_iter.bi_size);
1896+
bio->bi_iter.bi_done = 0;
18961897

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

0 commit comments

Comments
 (0)