blk-merge: fix computing bio->bi_seg_front_size in case of single segment
PATCH 1/1 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 02e707424c2ea(blk-merge: fix blk_bio_segment_split)
Reported-by Markus Trippelsdorf <[email protected]>
Tested-by Markus Trippelsdorf <[email protected]>
Signed-off-by Ming Lei <[email protected]>
--- block/blk-merge.c | 3 +++ 1 file changed, 3 insertions(+)
block/blk-merge.c +3 -0
@@ -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:
Signature · 1 line
1.9.1
Jens Axboe
maintainerQuoted 7 lines · Ming Lei
When bio has only one physical segment, we should set bio's
bi_seg_front_sizeas the real(final) size of the single segment.Fixes 02e707424c2ea(blk-merge: fix blk_bio_segment_split)Reported-by Markus Trippelsdorf <[email protected]>Tested-by Markus Trippelsdorf <[email protected]>Signed-off-by Ming Lei <[email protected]>
I'm going to fold this into the offending patch. Thanks Ming!
Signature · 1 line
Jens Axboe
Jens Axboe
maintainerQuoted 10 lines · Jens Axboe
Quoted 7 lines · Ming Lei
When bio has only one physical segment, we should set bio's
bi_seg_front_sizeas the real(final) size of the single segment.Fixes 02e707424c2ea(blk-merge: fix blk_bio_segment_split)Reported-by Markus Trippelsdorf <[email protected]>Tested-by Markus Trippelsdorf <[email protected]>Signed-off-by Ming Lei <[email protected]>I'm going to fold this into the offending patch. Thanks Ming!
Applied separately, I mixed up two different patches. Applied for 4.4.
Signature · 1 line
Jens Axboe