From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Ming Lei To: Jens Axboe Cc: linux-block@vger.kernel.org, Ming Lei , Marco Patalano , "Ewan D. Milne" Subject: [PATCH] blk-mq: update nr_requests when switching to 'none' scheduler Date: Sat, 2 Jun 2018 15:18:09 +0800 Message-Id: <20180602071809.4277-1-ming.lei@redhat.com> List-ID: Now we setup q->nr_requests when switching to one new scheduler, but not do it for 'none', then q->nr_requests may not be correct for 'none'. This patch fixes this issue by always updating 'nr_requests' when switching to 'none'. Cc: Marco Patalano Cc: "Ewan D. Milne" Signed-off-by: Ming Lei --- block/blk-mq-sched.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index b0f2c2a40a0c..b087d8884a08 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -585,6 +585,7 @@ int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e) if (!e) { q->elevator = NULL; + q->nr_requests = q->tag_set->queue_depth; return 0; } -- 2.9.5