Commit baa47c4f authored by Keith Busch's avatar Keith Busch
Browse files

nvme-pci: do not try to add queue maps at runtime



The block layer allocates the set's maps once. We can't add special
purpose queues at runtime if they weren't allocated at initialization
time.

Tested-by: default avatarKanchan Joshi <joshi.k@samsung.com>
Reviewed-by: default avatarKanchan Joshi <joshi.k@samsung.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 4735b510
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2902,6 +2902,18 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
	dev->nr_write_queues = write_queues;
	dev->nr_poll_queues = poll_queues;

	if (dev->ctrl.tagset) {
		/*
		 * The set's maps are allocated only once at initialization
		 * time. We can't add special queues later if their mq_map
		 * wasn't preallocated.
		 */
		if (dev->ctrl.tagset->nr_maps < 3)
			dev->nr_poll_queues = 0;
		if (dev->ctrl.tagset->nr_maps < 2)
			dev->nr_write_queues = 0;
	}

	/*
	 * The initial number of allocated queue slots may be too large if the
	 * user reduced the special queue parameters. Cap the value to the