From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com ([134.134.136.24]:28558 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752407AbeEKQXX (ORCPT ); Fri, 11 May 2018 12:23:23 -0400 From: Keith Busch To: linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me Cc: Charles Machalow , stable@vger.kernel.org, Keith Busch Subject: [PATCH] Fix controller reset return Date: Fri, 11 May 2018 10:25:01 -0600 Message-Id: <20180511162501.7258-1-keith.busch@intel.com> Sender: stable-owner@vger.kernel.org List-ID: From: Charles Machalow If the Controller Reset comes in when the device had no namespaces, we're incorrectly giving back ENETRESET. Fixes: 8000d1fdb0 ("nvme-rdma: fix sysfs invoked reset_ctrl error flow ") Cc: Signed-off-by: Charles Machalow Signed-off-by: Keith Busch --- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index cd03f2bdac7b..b4eb74f14c02 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -117,7 +117,8 @@ int nvme_reset_ctrl_sync(struct nvme_ctrl *ctrl) ret = nvme_reset_ctrl(ctrl); if (!ret) { flush_work(&ctrl->reset_work); - if (ctrl->state != NVME_CTRL_LIVE) + if (ctrl->state != NVME_CTRL_LIVE && + ctrl->state != NVME_CTRL_ADMIN_ONLY) ret = -ENETRESET; } -- 2.14.3