4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Machalow charles.machalow@intel.com
commit 4e50d9ebaeaa3c6761d2b513ef7039510c8cf213 upstream.
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: 8000d1fdb0 ("nvme-rdma: fix sysfs invoked reset_ctrl error flow ") Cc: stable@vger.kernel.org Signed-off-by: Charles Machalow charles.machalow@intel.com [changelog] Signed-off-by: Keith Busch keith.busch@intel.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -122,7 +122,8 @@ int nvme_reset_ctrl_sync(struct nvme_ctr 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; }