nvme/multipath: Fix multipath disabled naming collisions
authorKeith Busch <keith.busch@intel.com>
Thu, 26 Apr 2018 20:22:41 +0000 (14:22 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2018 19:01:34 +0000 (04:01 +0900)
commit38c3d8237d45bdb8aa0dea3ff96ca50fbac056ff
tree739cd26bceb1f10ab65edeccca4d8e76d708de44
parent44ac74871de3ad04f73149f463a4be484cdee84a
nvme/multipath: Fix multipath disabled naming collisions

[ Upstream commit a785dbccd95c37606c720580714f5a7a8b3255f1 ]

When CONFIG_NVME_MULTIPATH is set, but we're not using nvme to multipath,
namespaces with multiple paths were not creating unique names due to
reusing the same instance number from the namespace's head.

This patch fixes this by falling back to the non-multipath naming method
when the parameter disabled using multipath.

Reported-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/host/core.c
drivers/nvme/host/multipath.c
drivers/nvme/host/nvme.h