[RFC PATCH] nvme: add 'queue_if_no_path' semantics

Christoph Hellwig hch at lst.de
Mon Oct 5 05:24:05 EDT 2020


On Fri, Oct 02, 2020 at 06:06:34PM +0200, Hannes Reinecke wrote:
> Currently namespaces behave differently depending on the 'CMIC'
> setting. If CMIC is zero, the device is removed once the last path
> goes away. If CMIC has the multipath bit set, the device is retained
> even if the last path is removed.
> This is okay for fabrics, where one can do an explicit disconnect
> to remove the device, but for nvme-pci this induces a regression
> with PCI hotplug.
> When the NVMe device is opened (eg by MD), the NVMe device is not
> removed after a PCI hot-remove. Hence MD will not be notified about
> the event, and will continue to consider this device as operational.
> Consequently, upon PCI hot-add the device shows up as a new NVMe
> device, and MD will fail to reattach the device.
> So this patch adds NVME_NSHEAD_QUEUE_IF_NO_PATH flag to the nshead
> to restore the original behaviour for non-fabrics NVMe devices.
> 
> Suggested-by: Keith Busch <keith.busch at wdc.com>
> Signed-off-by: Hannes Reinecke <hare at suse.de>

This seems to include the patch from Keith to tear down the disk
earlier. I think that needs to stay a separate prep patch, otherwise
it will be very hard to review and reason about.



More information about the Linux-nvme mailing list