Re: [PATCH] nvme: Use first ctrl->instance id as subsystem id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 14, 2019 at 07:28:36AM -0700, Guilherme G. Piccoli wrote:
> Since after the introduction of NVMe multipath, we have a struct to
> track subsystems, and more important, we have now the nvme block device
> name bound to the subsystem id instead of ctrl->instance as before.
> This is not a big problem, users can even fallback to the old behavior
> using the module parameter "nvme_core.multipath=N" in case they don't
> have multipath and wish to have a consistent mapping between the char
> device nvmeX and the block device nvmeXnY.
> 
> That said, we noticed the nvme subsystem id is generated by its own ID
> allocator, and ctrl->instance value has itself an ID allocator too.
> The controller instance is generated during the probe, in the function
> nvme_init_ctrl(), which always executes before nvme_init_subsystem().
> That said, and since according to the spec we have a relation 1:N
> between subsystem and controllers (i.e., one subsystem may have more
> controllers but not the reciprocal), why not use the ctrl->instance id
> as the subsystem id?

The subsystem lifetime is not tied to a single controller's. Disconnect
the "first" controller in a multipathed subsystem with this patch, then
connect another controller from a different subsystem, and now you will
create naming collisions.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux