Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e50d9eb authored by Charles Machalow's avatar Charles Machalow Committed by Keith Busch
Browse files

nvme: Fix sync controller reset return



If a controller reset is requested while the device has no namespaces,
we were incorrectly returning ENETRESET. This patch adds the check for
ADMIN_ONLY controller state to indicate a successful reset.

Fixes: 8000d1fd  ("nvme-rdma: fix sysfs invoked reset_ctrl error flow ")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarCharles Machalow <charles.machalow@intel.com>
[changelog]
Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
parent 12d9f070
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -118,7 +118,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;
	}