[RFC PATCH] nvme: add 'queue_if_no_path' semantics

Hannes Reinecke hare at suse.de
Mon Oct 5 05:30:50 EDT 2020


On 10/5/20 11:24 AM, Christoph Hellwig wrote:
> 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.
> 
Wasn't sure how to approach this best, but yes, sure, I can split it off 
into separate patches, with that one from Keith being the first one.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer



More information about the Linux-nvme mailing list