From f750c4ebb553cb726a4f35fea01d98d2765fb9e3 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 11 May 2018 10:00:17 -0700 Subject: [PATCH] nvme: apply Identify CNS quirk to NS ID Descriptor Avoid sending CNS values other than 0 and 1 to controllers with the Identify CNS quirk added in commit 6442451b1037 ("nvme: add a quirk for identify 0x2"). This probably doesn't affect either of the controllers with the quirk in practice, since this command is already only sent to controllers that report NVMe version 1.3 or newer, but let's add the check anyway for consistency. Change-Id: I858c28ab7d43714c501dd22d6797259054f0f0a8 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/410941 Tested-by: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/nvme/nvme_ns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nvme/nvme_ns.c b/lib/nvme/nvme_ns.c index e85ff857a..1e13fca65 100644 --- a/lib/nvme/nvme_ns.c +++ b/lib/nvme/nvme_ns.c @@ -124,7 +124,8 @@ int nvme_ns_identify_update(struct spdk_nvme_ns *ns) } memset(ns->id_desc_list, 0, sizeof(ns->id_desc_list)); - if (ns->ctrlr->vs.raw >= SPDK_NVME_VERSION(1, 3, 0)) { + if (ns->ctrlr->vs.raw >= SPDK_NVME_VERSION(1, 3, 0) && + !(ns->ctrlr->quirks & NVME_QUIRK_IDENTIFY_CNS)) { SPDK_DEBUGLOG(SPDK_LOG_NVME, "Attempting to retrieve NS ID Descriptor List\n"); status.done = false; rc = nvme_ctrlr_cmd_identify(ns->ctrlr, SPDK_NVME_IDENTIFY_NS_ID_DESCRIPTOR_LIST, 0, ns->id,