nvme: Assign subsys instance from first ctrl
authorKeith Busch <kbusch@kernel.org>
Thu, 5 Sep 2019 16:33:54 +0000 (10:33 -0600)
committerSagi Grimberg <sagi@grimberg.me>
Thu, 12 Sep 2019 15:50:46 +0000 (08:50 -0700)
commit733e4b69d508d03c20adfdcf4bd27abc60fae9cc
treeeaab35e63c94ebf354deb53dd0acdc38cc3e6a5c
parent312910f4d2fed987d1f4a6cd75e86c926e9ad557
nvme: Assign subsys instance from first ctrl

The namespace disk names must be unique for the lifetime of the
subsystem. This was accomplished by using their parent subsystems'
instances which were allocated independently from the controllers
connected to that subsystem. This allowed name prefixes assigned to
namespaces to match a controller from an unrelated subsystem, and has
created confusion among users examining device nodes.

Ensure a namespace's subsystem instance never clashes with a controller
instance of another subsystem by transferring the instance ownership
to the parent subsystem from the first controller discovered in that
subsystem.

Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Minwoo Im <minwoo.im@samsung.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/core.c