summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@grimberg.me>2017-09-21 17:01:37 +0300
committerJens Axboe <axboe@kernel.dk>2017-09-25 12:42:11 -0600
commit0a960afd60d02808c7f7f36d4aa8a2e07045e1e9 (patch)
tree595bbd5401dd60817b57e36f1a457eae9786202f /drivers/nvme
parent1a40d97288c6ffea9b355139e88fa62f0e5439f7 (diff)
downloadlinux-0a960afd60d02808c7f7f36d4aa8a2e07045e1e9.tar.gz
linux-0a960afd60d02808c7f7f36d4aa8a2e07045e1e9.tar.bz2
linux-0a960afd60d02808c7f7f36d4aa8a2e07045e1e9.zip
nvme-rdma: give up reconnect if state change fails
If we failed to transition to state LIVE after a successful reconnect, then controller deletion already started. In this case there is no point moving forward with reconnect. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/rdma.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 58983000964b..8441f6b3f617 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -942,7 +942,12 @@ static void nvme_rdma_reconnect_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;
+ }
+
ctrl->ctrl.nr_reconnects = 0;
nvme_start_ctrl(&ctrl->ctrl);