diff --git a/block/blk-mq.c b/block/blk-mq.c index dec70ca0aafdae1683ef0d7eb4b658f84119b7bc..03a7471056829de6ba0a4a5d42ff4ad1fc5bc387 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2336,15 +2336,15 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, blk_mq_init_cpu_queues(q, set->nr_hw_queues); - get_online_cpus(); mutex_lock(&all_q_mutex); + get_online_cpus(); list_add_tail(&q->all_q_node, &all_q_list); blk_mq_add_queue_tag_set(set, q); blk_mq_map_swqueue(q, cpu_online_mask); - mutex_unlock(&all_q_mutex); put_online_cpus(); + mutex_unlock(&all_q_mutex); if (!(set->flags & BLK_MQ_F_NO_SCHED)) { int ret;