]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: allow duplicate NSIDs for private namespaces
authorSungup Moon <sungup.moon@samsung.com>
Mon, 14 Mar 2022 11:05:45 +0000 (20:05 +0900)
committerChristoph Hellwig <hch@lst.de>
Tue, 29 Mar 2022 07:29:06 +0000 (09:29 +0200)
commit74654d2cef7bab0d26f0d81c2778e4fab0dfd33e
tree964321bf3cbb0440cf8a37ec37a67e1ae5ab36a6
parent3420ea63ac259e9f1e31a133ed02b733fa9974ea
nvme: allow duplicate NSIDs for private namespaces

A NVMe subsystem with multiple controller can have private namespaces
that use the same NSID under some conditions:

 "If Namespace Management, ANA Reporting, or NVM Sets are supported, the
  NSIDs shall be unique within the NVM subsystem. If the Namespace
  Management, ANA Reporting, and NVM Sets are not supported, then NSIDs:
   a) for shared namespace shall be unique; and
   b) for private namespace are not required to be unique."

Reference: Section 6.1.6 NSID and Namespace Usage; NVM Express 1.4c spec.

Make sure this specific setup is supported in Linux.

Fixes: 6aeb02d09032 ("nvme: always search for namespace head")
Signed-off-by: Sungup Moon <sungup.moon@samsung.com>
[hch: refactored and fixed the controller vs subsystem based naming
      conflict]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/core.c
drivers/nvme/host/multipath.c
drivers/nvme/host/nvme.h
include/linux/nvme.h