From 35d003dfed8e494a5034d18e3840d9d6783b9344 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Wed, 28 Apr 2021 11:26:32 -0700 Subject: [PATCH] nvme: remove IDENTIFY_CNS quirk from normal QEMU SSDs The IDENTIFY_CNS quirk was applied as part of QEMU OCSSD handling in commit 6442451b. But it was applied not only to the OCSSD dev ID, but also the dev ID for non-OCSSD NVMe controllers. Starting with QEMU 5.2, QEMU will allocate a default 256 namespaces, but only some are active (associated with the backing disks specified by the user). QEMU supports IDENTIFY_CNS, but since this quirk was set, we wouldn't send a real IDENTIFY_CNS and instead would just populate a fake list where all namespaces were considered active. This causes breakage in a few places - mainly where we iterate through the active namespaces, and then are surprised that calling spdk_nvme_ns_is_active() returns false. It was also breaking bdev_nvme_attach_controller RPC, since by default we can only support returning 128 names, but since all of the namespaces were deemed active, it was trying to return 256. Fixes #1916. Signed-off-by: Jim Harris Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7658 (master) (cherry picked from commit 6fd1cc3716d847e708742f9b533325b6a747eb6b) Change-Id: I4fdd27e0e36f0ac07a95f9f29aa83357e8505a45 Signed-off-by: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7674 Reviewed-by: Tomasz Zawadzki Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- lib/nvme/nvme_quirks.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/nvme/nvme_quirks.c b/lib/nvme/nvme_quirks.c index 7355ea263..a529933f2 100644 --- a/lib/nvme/nvme_quirks.c +++ b/lib/nvme/nvme_quirks.c @@ -89,7 +89,6 @@ static const struct nvme_quirk nvme_quirks[] = { NVME_QUIRK_DELAY_AFTER_QUEUE_ALLOC }, { {SPDK_PCI_CLASS_NVME, SPDK_PCI_VID_INTEL, 0x5845, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID}, - NVME_QUIRK_IDENTIFY_CNS | NVME_INTEL_QUIRK_NO_LOG_PAGES | NVME_QUIRK_MAXIMUM_PCI_ACCESS_WIDTH },