blk-mq: initialize q->nr_requests after calling blk_queue_make_request()
authorJens Axboe <axboe@fb.com>
Tue, 20 May 2014 21:17:27 +0000 (15:17 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 20 May 2014 21:17:27 +0000 (15:17 -0600)
blk_queue_make_requests() overwrites our set value for q->nr_requests,
turning it into the default of 128. Set this appropriately after
initializing queue values in blk_queue_make_request().

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

index 7b71ab1b1536f809b4ab884cf7df7315943c62c9..fec8fcc4f8a4ea0f3a866bc4feaae6feb73eb4f5 100644 (file)
@@ -1623,6 +1623,11 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set)
        if (set->timeout)
                blk_queue_rq_timeout(q, set->timeout);
 
+       /*
+        * Do this after blk_queue_make_request() overrides it...
+        */
+       q->nr_requests = set->queue_depth;
+
        if (set->ops->complete)
                blk_queue_softirq_done(q, set->ops->complete);