From c4e1a4f01919b56a18eccce6a82264b33f84601c Mon Sep 17 00:00:00 2001 From: Keith Busch Date: Tue, 14 Dec 2021 19:20:13 +0800 Subject: [PATCH] nvme: Namepace identification descriptor list is optional mainline inclusion from mainline-v5.5-rc2 commit 22802bf742c25b1e2473c70b3b99da98af65ef4d category: bugfix bugzilla: NA CVE: NA Link: https://gitee.com/openeuler/kernel/issues/I4JFBE?from=project-issue ------------------------------------------------- Despite NVM Express specification 1.3 requires a controller claiming to be 1.3 or higher implement Identify CNS 03h (Namespace Identification Descriptor list), the driver doesn't really need this identification in order to use a namespace. The code had already documented in comments that we're not to consider an error to this command. Return success if the controller provided any response to an namespace identification descriptors command. Fixes: 538af88ea7d9de24 ("nvme: make nvme_report_ns_ids propagate error back") Link: https://bugzilla.kernel.org/show_bug.cgi?id=205679 Reported-by: Ingo Brunberg Cc: Sagi Grimberg Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: chengjike Reviewed-by: Hou Tao Signed-off-by: Yang Yingliang --- drivers/nvme/host/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 922036426c67..64f91e4a97fc 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1608,6 +1608,8 @@ static int nvme_report_ns_ids(struct nvme_ctrl *ctrl, unsigned int nsid, if (ret) dev_warn(ctrl->device, "Identify Descriptors failed (%d)\n", ret); + if (ret > 0) + ret = 0; } return ret; } -- GitLab