]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: fix block device naming collision
authorIsrael Rukshin <israelr@nvidia.com>
Thu, 14 Jul 2022 12:42:10 +0000 (12:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jul 2022 15:25:12 +0000 (17:25 +0200)
commit89dd2c1b80fe64db5fac54190c326f513461c584
tree941ff8ac8b3140cb7ef4a34b84eaf1253a55b39a
parentf9888318e10ac2cdf4d83ea3e22eff83cf649a22
nvme: fix block device naming collision

[ Upstream commit a9eb60865b3a4a2afe13b202119223323b8b55df ]

The issue exists when multipath is enabled and the namespace is
shared, but all the other controller checks at nvme_is_unique_nsid()
are false. The reason for this issue is that nvme_is_unique_nsid()
returns false when is called from nvme_mpath_alloc_disk() due to an
uninitialized value of head->shared. The patch fixes it by setting
head->shared before nvme_mpath_alloc_disk() is called.

Fixes: 74654d2cef7b ("nvme: allow duplicate NSIDs for private namespaces")
Signed-off-by: Israel Rukshin <israelr@nvidia.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c