[PATCH AUTOSEL 5.10 18/18] nvme-pci: disable namespace identifiers for Qemu controllers

Luis Chamberlain mcgrof at kernel.org
Wed Apr 20 11:52:36 PDT 2022


On Tue, Apr 19, 2022 at 02:13:52PM -0400, Sasha Levin wrote:
> From: Christoph Hellwig <hch at lst.de>
> 
> [ Upstream commit 66dd346b84d79fde20832ed691a54f4881eac20d ]
> 
> Qemu unconditionally reports a UUID, which depending on the qemu version
> is either all-null (which is incorrect but harmless) or contains a single
> bit set for all controllers.  In addition it can also optionally report
> a eui64 which needs to be manually set.  Disable namespace identifiers
> for Qemu controlles entirely even if in some cases they could be set
> correctly through manual intervention.
> 
> Reported-by: Luis Chamberlain <mcgrof at kernel.org>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> Reviewed-by: Keith Busch <kbusch at kernel.org>
> Reviewed-by: Sagi Grimberg <sagi at grimberg.me>
> Signed-off-by: Sasha Levin <sashal at kernel.org>

Huh? The NVME_QUIRK_BOGUS_NID is a new define and the code which uses
this quirk is also new, and so I'm curious *how and why* the auto-sel
stuff for stable can decide to merge this and this should not even
compile? I see this was backported to v5.15  and v5.17 as well.

I didn't get Cc'd on perhaps some other patches, but this immediately
caught my attention as not applicable, unless of course the patch
"nvme: add a quirk to disable namespace identifiers" was also sent
as part of this series to stable kernels. And if that was done, well
holy crap, really?

Cc'ing Klaus on the qemu side of things so he's aware.

  Luis

> ---
>  drivers/nvme/host/pci.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 97afeb898b25..6939b03a16c5 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -3212,7 +3212,10 @@ static const struct pci_device_id nvme_id_table[] = {
>  		.driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, },
>  	{ PCI_VDEVICE(INTEL, 0x5845),	/* Qemu emulated controller */
>  		.driver_data = NVME_QUIRK_IDENTIFY_CNS |
> -				NVME_QUIRK_DISABLE_WRITE_ZEROES, },
> +				NVME_QUIRK_DISABLE_WRITE_ZEROES |
> +				NVME_QUIRK_BOGUS_NID, },
> +	{ PCI_VDEVICE(REDHAT, 0x0010),	/* Qemu emulated controller */
> +		.driver_data = NVME_QUIRK_BOGUS_NID, },
>  	{ PCI_DEVICE(0x126f, 0x2263),	/* Silicon Motion unidentified */
>  		.driver_data = NVME_QUIRK_NO_NS_DESC_LIST, },
>  	{ PCI_DEVICE(0x1bb1, 0x0100),   /* Seagate Nytro Flash Storage */
> -- 
> 2.35.1
> 



More information about the Linux-nvme mailing list