Skip to content

Commit e5edd5f

Browse files
Ming Leiaxboe
authored andcommitted
blk-mq: skip zero-queue maps in blk_mq_map_swqueue
From 7e849dd ("nvme-pci: don't share queue maps"), the mapping table won't be initialized actually if map->nr_queues is zero, so we can't use blk_mq_map_queue_type() to retrieve hctx any more. This way still may cause broken mapping, fix it by skipping zero-queues maps in blk_mq_map_swqueue(). Cc: Jeff Moyer <jmoyer@redhat.com> Cc: Mike Snitzer <snitzer@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 1336981 commit e5edd5f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

block/blk-mq.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,6 +2438,9 @@ static void blk_mq_map_swqueue(struct request_queue *q)
24382438

24392439
ctx = per_cpu_ptr(q->queue_ctx, i);
24402440
for (j = 0; j < set->nr_maps; j++) {
2441+
if (!set->map[j].nr_queues)
2442+
continue;
2443+
24412444
hctx = blk_mq_map_queue_type(q, j, i);
24422445

24432446
/*

0 commit comments

Comments
 (0)