stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix controller reset return
@ 2018-05-11 16:25 Keith Busch
  2018-05-11 16:36 ` Keith Busch
  2018-05-25  9:10 ` Christoph Hellwig
  0 siblings, 2 replies; 5+ messages in thread
From: Keith Busch @ 2018-05-11 16:25 UTC (permalink / raw)
  To: linux-nvme, hch, sagi; +Cc: Charles Machalow, stable, Keith Busch

From: Charles Machalow <charles.machalow@intel.com>

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: <stable@vger.kernel.org>
Signed-off-by: Charles Machalow <charles.machalow@intel.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-25 14:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-11 16:25 [PATCH] Fix controller reset return Keith Busch
2018-05-11 16:36 ` Keith Busch
2018-05-25  9:10 ` Christoph Hellwig
2018-05-25 14:50   ` Keith Busch
2018-05-25 14:55     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).