From: Sagi Grimberg <sagi@grimberg.me>
Date: Wed, 11 Oct 2017 12:49:51 +0300
Subject: nvme-rdma: stop controller reset if the controller is deleting
Patch-mainline: v4.15-rc1
Git-commit: 0ad0bfa29822904b9186a1c04dbfb3014bc5dc8a
References: FATE#323952, FATE#322506
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 | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1820,7 +1820,11 @@ static void nvme_rdma_reset_ctrl_work(st
}
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);