]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: fix the check for duplicate unique identifiers
authorChristoph Hellwig <hch@lst.de>
Thu, 24 Feb 2022 10:32:58 +0000 (11:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:07 +0000 (14:23 +0200)
commitd375fe11c0bb22f48b98f9eec1277409f788926a
tree18f0c24fbfd61937daa5b5c0d34a54f7fda38429
parent3055b295fd97c90803dcf58b28b59eb8ab26b333
nvme: fix the check for duplicate unique identifiers

[ Upstream commit 13d9538235f50fa00888866a8200843591ab0946 ]

nvme_subsys_check_duplicate_ids should needs to return an error if any of
the identifiers matches, not just if all of them match.  But it does not
need to and should not look at the CSI value for this sanity check.

Rewrite the logic to be separate from nvme_ns_ids_equal and optimize it
by reducing duplicate checks for non-present identifiers.

Fixes: 9cf63492537d ("nvme: track shared namespaces")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c