nvme-pci: return early on ctrl state mismatch in nvme_reset_work
authorChristoph Hellwig <hch@lst.de>
Tue, 22 Nov 2022 07:48:13 +0000 (08:48 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 6 Dec 2022 13:36:54 +0000 (14:36 +0100)
The only way nvme_reset_work could be called when not in resetting state
is if a reset and remove happen near the same time.  This should not
happen, but if it did we don't want the reset work to disable the
controller because the remove is already doing that.

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

index 1b52737..02940b4 100644 (file)
@@ -2792,8 +2792,7 @@ 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);
-               result = -ENODEV;
-               goto out;
+               return;
        }
 
        /*