From: Ming Lei Date: Mon, 30 Nov 2015 08:05:49 +0000 (+0800) Subject: blk-merge: fix computing bio->bi_seg_front_size in case of single segment X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a88d32af18b8a6616128c971f766eaf545966405;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Tested-by: Markus Trippelsdorf Signed-off-by: Ming Lei Signed-off-by: Jens Axboe --- diff --git a/block/blk-merge.c b/block/blk-merge.c index 41a55ba0d78e..e01405a3e8b3 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -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: