Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ static int __bio_clone(struct bio *bio, struct bio *bio_src, gfp_t gfp)
bio->bi_ioprio = bio_src->bi_ioprio;
bio->bi_write_hint = bio_src->bi_write_hint;
bio->bi_write_stream = bio_src->bi_write_stream;
bio->bi_bvec_gap_bit = bio_src->bi_bvec_gap_bit;
bio->bi_iter = bio_src->bi_iter;

if (bio->bi_bdev) {
Expand Down Expand Up @@ -1863,6 +1864,14 @@ struct bio *bio_split(struct bio *bio, int sectors,

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

/*
* The gap bit is set when splitting to limits and only applies to the
* front bio that was split off. The remaining bio will calcualte its
* gap value when it is subsequently split to limits, so it is safe to
* re-initialize the value back to 0.
*/
bio->bi_bvec_gap_bit = 0;

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

Expand Down