[PATCH] Fix controller reset return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Charles Machalow <charles.machalow@xxxxxxxxx>

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@xxxxxxxxxxxxxxx>
Signed-off-by: Charles Machalow <charles.machalow@xxxxxxxxx>
Signed-off-by: Keith Busch <keith.busch@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux