nvme-rdma: stop controller reset if the controller is deleting
authorSagi Grimberg <sagi@grimberg.me>
Wed, 11 Oct 2017 09:49:51 +0000 (12:49 +0300)
committerChristoph Hellwig <hch@lst.de>
Wed, 18 Oct 2017 17:29:39 +0000 (19:29 +0200)
If the controller is deleting (in case the user decided to delete it), we
have no point to continue reset sequence.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/rdma.c

index ff67375982fe89b1879b3c6242ec98847c53088e..34d22ff42afbad6d14ad05e3f96ec8cd789125b1 100644 (file)
@@ -1818,7 +1818,11 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
        }
 
        changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
-       WARN_ON_ONCE(!changed);
+       if (!changed) {
+               /* state change failure is ok if we're in DELETING state */
+               WARN_ON_ONCE(ctrl->ctrl.state != NVME_CTRL_DELETING);
+               return;
+       }
 
        nvme_start_ctrl(&ctrl->ctrl);