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; }
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.
On Fri, May 25, 2018 at 08:50:09AM -0600, Keith Busch wrote:
On Fri, May 25, 2018 at 02:10:56AM -0700, Christoph Hellwig wrote:
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.
linux-stable-mirror@lists.linaro.org