From: Sagi Grimberg Date: Thu, 21 Sep 2017 14:01:37 +0000 (+0300) Subject: nvme-rdma: give up reconnect if state change fails X-Git-Tag: v4.14-rc3~35^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a960afd60d02808c7f7f36d4aa8a2e07045e1e9;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 5898300..8441f6b 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);