]> 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)
committerChristoph Hellwig <hch@lst.de>
Mon, 28 Feb 2022 11:45:07 +0000 (13:45 +0200)
commitd1a9c852a5113e81b94158a8e9c58f32c26401d1
treefc4c35dc3229090fbd9f2b3606f919a5862d2aeb
parent197a87b339a4e2a7b5152cf4fa9104a175c61417
nvme: fix the check for duplicate unique identifiers

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: 25a47702dbaf ("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>
drivers/nvme/host/core.c