Skip to contentSkip to conversation

Fix controller reset return

PATCH New Keith Busch 4 participants 5 messages May 11, 2018 – May 25, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix controller reset return

From: Charles Machalow <[email protected]>

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 ")
---
 drivers/nvme/host/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +2 -1
index cd03f2bdac7b..b4eb74f14c02 100644
@@ -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;
 	}
 
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/1 Fix controller reset return

I'll just need to append "nvme:" to the front of the changelog subject, otherwise I think this is a trivial fix.

For future, there are multiple places that look for LIVE and ADMIN_ONLY, so might be worth refactoring this into a function later.

#3 lore raw

PATCH 1/1 Fix controller reset return

Quoted 3 lines · Christoph Hellwig

Thanks,

applied to nvme-4.18-2

I'd included this one in an earlier 4.17 pull request. The regression caused some major problems in test automation, and the fix was trivial.

#4 lore raw

PATCH 1/1 Fix controller reset return

Quoted 7 lines · Keith Busch
Quoted 3 lines · Christoph Hellwig

Thanks,

applied to nvme-4.18-2

I'd included this one in an earlier 4.17 pull request. The regression caused some major problems in test automation, and the fix was trivial.

ok, I'll drop it again to avoid a duplicate commit.