From d3946db93c8eb1da4a0c32249d603f415febf09e Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Thu, 9 Oct 2014 23:17:35 +0800 Subject: [PATCH] blk-merge: don't compute bi_phys_segments from bi_vcnt for cloned bio It isn't correct to figure out req->bi_phys_segments from bio->bi_vcnt if the bio is cloned. Signed-off-by: Ming Lei --- block/blk-merge.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-merge.c b/block/blk-merge.c index f71bad3..d5cad1a 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -98,6 +98,7 @@ void blk_recalc_rq_segments(struct request *rq) void blk_recount_segments(struct request_queue *q, struct bio *bio) { if (test_bit(QUEUE_FLAG_NO_SG_MERGE, &q->queue_flags) && + !bio_flagged(bio, BIO_CLONED) && bio->bi_vcnt < queue_max_segments(q)) bio->bi_phys_segments = bio->bi_vcnt; else { -- 1.7.9.5