nvme: disable controller on reset state failure
authorKeith Busch <kbusch@kernel.org>
Wed, 28 Jun 2023 14:51:02 +0000 (07:51 -0700)
committerKeith Busch <kbusch@kernel.org>
Fri, 30 Jun 2023 17:48:20 +0000 (10:48 -0700)
If the controller is not in a RESETTING state at the point of reset
work, we have to conclude the controller is being deleted. Go to the
cleanup on this condition to ensure proper pairing of request_queue
quiesce state.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/pci.c

index bfeadec..c9224d3 100644 (file)
@@ -2690,7 +2690,8 @@ static void nvme_reset_work(struct work_struct *work)
        if (dev->ctrl.state != NVME_CTRL_RESETTING) {
                dev_warn(dev->ctrl.device, "ctrl state %d is not RESETTING\n",
                         dev->ctrl.state);
-               return;
+               result = -ENODEV;
+               goto out;
        }
 
        /*