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.