From: Sagi Grimberg Date: Wed, 11 Oct 2017 09:49:51 +0000 (+0300) Subject: nvme-rdma: stop controller reset if the controller is deleting X-Git-Tag: v5.15~10032^2~86^2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ad0bfa29822904b9186a1c04dbfb3014bc5dc8a;p=platform%2Fkernel%2Flinux-starfive.git nvme-rdma: stop controller reset if the controller is deleting 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 Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index ff67375..34d22ff 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -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);