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

Commit a88d32af authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe
Browse files

blk-merge: fix computing bio->bi_seg_front_size in case of single segment



When bio has only one physical segment, we should set bio's
bi_seg_front_size as the real(final) size of the single segment.

Fixes: 02e70742(blk-merge: fix blk_bio_segment_split)
Reported-by: default avatarMarkus Trippelsdorf <markus@trippelsdorf.de>
Tested-by: default avatarMarkus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 74cedf9b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -103,6 +103,9 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
			bvprv = bv;
			bvprvp = &bvprv;
			sectors += bv.bv_len >> 9;

			if (nsegs == 1 && seg_size > front_seg_size)
				front_seg_size = seg_size;
			continue;
		}
new_segment: