[PATCH 3/6] nvme: claim block devices

Christoph Hellwig hch at lst.de
Mon Oct 2 09:42:18 PDT 2017


On Mon, Oct 02, 2017 at 03:55:56PM +0200, Hannes Reinecke wrote:
> When setting up a multipath device we need to claim the underlying
> block devices to avoid other systems and/or programs to access it.
> And we should be using the standard holders/slave sysfs relationship
> instead of the hand-crafted 'mpath' links.

This completely breaks backwards compatibility:

root at testvm:~# mkfs.xfs /dev/nvme0n1 -f
mkfs.xfs: cannot open /dev/nvme0n1: Device or resource busy

Also we really do not want and outstanding struct block_device reference
all the time - struct block_device should only have a reference if
the block device node is in use or a file system is mounted.  Avoiding
this case was the whole point of my refactor to store the gendisk
instead of the block_device in struct bio.



More information about the Linux-nvme mailing list