blk-mq: avoid re-initialize request which is failed in direct dispatch
authorShaohua Li <shli@fb.com>
Fri, 8 May 2015 17:51:31 +0000 (10:51 -0700)
committerJens Axboe <axboe@fb.com>
Fri, 8 May 2015 20:17:19 +0000 (14:17 -0600)
If we directly issue a request and it fails, we use
blk_mq_merge_queue_io(). But we already assigned bio to a request in
blk_mq_bio_to_request. blk_mq_merge_queue_io shouldn't run
blk_mq_bio_to_request again.

Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c

index a65acffde19ae336256cc1a864a7997b8782e0f6..f13d0de42f5372ddc7cf35262b52eeb977e9c3ec 100644 (file)
@@ -1284,6 +1284,8 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
                                blk_mq_end_request(rq, rq->errors);
                                goto done;
                        }
+                       blk_mq_insert_request(rq, false, true, true);
+                       return;
                }
        }