]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
NVMe: Delete only created queues
authorKeith Busch <keith.busch@intel.com>
Fri, 6 May 2016 17:50:52 +0000 (11:50 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 1 Jun 2017 20:41:23 +0000 (13:41 -0700)
Use the online queue count instead of the number of allocated queues. The
controller should just return an invalid queue identifier error to the
commands if a queue wasn't created. While it's not harmful, it's still
not correct.

Reported-by: Saar Gross <saar@annapurnalabs.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 014a0d609eb4721d1e416cf10da2d5602f9b34d5)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/nvme/host/pci.c

index d336cdaf996eba512f5def9026de7b68a48aab1d..839f4fb5e80bfa402981ab3bb0e948573b7b1a9d 100644 (file)
@@ -1578,12 +1578,12 @@ static int nvme_delete_queue(struct nvme_queue *nvmeq, u8 opcode)
 
 static void nvme_disable_io_queues(struct nvme_dev *dev)
 {
-       int pass;
+       int pass, queues = dev->online_queues - 1;
        unsigned long timeout;
        u8 opcode = nvme_admin_delete_sq;
 
        for (pass = 0; pass < 2; pass++) {
-               int sent = 0, i = dev->queue_count - 1;
+               int sent = 0, i = queues;
 
                reinit_completion(&dev->ioq_wait);
  retry: