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 6442451b10 ("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 <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410941
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2018-05-11 10:00:17 -07:00 committed by Jim Harris
parent d6d097a18d
commit f750c4ebb5

View File

@ -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,