[PATCHv3] nvme-mpath: delete disk after last connection

Hannes Reinecke hare at suse.de
Fri May 7 18:02:52 BST 2021


On 5/7/21 8:46 AM, Christoph Hellwig wrote:
> On Thu, May 06, 2021 at 05:54:29PM +0200, Hannes Reinecke wrote:
>> PCI and fabrics have different defaults; for PCI the device goes away if
>> the last path (ie the controller) goes away, for fabrics it doesn't if the
>> device is mounted.
> 
> Err, no.  For fabrics we reconnect a while, but otherwise the behavior
> is the same right now.
> 
No, that is not the case.

When a PCI nvme device with CMIC=0 is removed (via pci hotplug, say), 
the nvme device is completely removed, irrespective on whether it's 
mounted or not.
When the _same_ PCI device with CMIC=1 is removed, the nvme device (ie 
the nsnhead) will _stay_ when mounted (as the refcount is not zero).

This can be easily demonstrated on qemu; just set the 'subsys' parameter 
for the nvme device.

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