diff --git a/block/blk-mq.c b/block/blk-mq.c index c4fa587613acaebc297ecf609f717c407a5c8919..c2cbeabb4e3f45cf7ec8cbd186579f3f80915641 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2898,6 +2898,14 @@ static int blk_mq_alloc_rq_maps(struct blk_mq_tag_set *set) static int blk_mq_update_queue_map(struct blk_mq_tag_set *set) { + /* + * blk_mq_map_queues() and multiple .map_queues() implementations + * expect that set->map[HCTX_TYPE_DEFAULT].nr_queues is set to the + * number of hardware queues. + */ + if (set->nr_maps == 1) + set->map[HCTX_TYPE_DEFAULT].nr_queues = set->nr_hw_queues; + if (set->ops->map_queues && !is_kdump_kernel()) { int i;