From: Ming Lei Date: Sat, 2 Jun 2018 07:18:09 +0000 (+0800) Subject: blk-mq: update nr_requests when switching to 'none' scheduler X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=32a50fabb334b2f0725de84bf248bd8c24c22b05;p=openwrt%2Fstaging%2Fblogic.git blk-mq: update nr_requests when switching to 'none' scheduler 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 Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index b1f06088cee5..56c493c6cd90 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; }