Skip to contentSkip to conversation

Start to disable shared ns without multipating

PATCH New Irvin Cote 1 participant 4 messages May 30, 2023 NVMe

lore
Share & tools
lore

Irvin Cote

author
#0 lore raw

cover Start to disable shared ns without multipating

Staring to disable support for shared namespaces without multipathing enabled. This is not meant to be an exhaustive list but rather a start.

Irvin Cote (3):
nvme-Kconfig: updating MULTIPATH option's description
nvme-core: exit scan if shared ns but no multipath
nvme-core: changing comment on disk names in nvme_alloc_ns

 drivers/nvme/host/Kconfig |  2 ++
 drivers/nvme/host/core.c  | 12 ++++++------
 2 files changed, 8 insertions(+), 6 deletions(-)
Signature · 1 line
2.40.1
author
#1 lore raw

PATCH 1/3 nvme-Kconfig: updating MULTIPATH option's description

In the MULTIPATH build option's description, mention that the option is mandatory to support shared namespaces.

---
 drivers/nvme/host/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/nvme/host/Kconfig +2 -0
index 2f6a7f8c94e8..f22cf71b205d 100644
@@ -23,6 +23,8 @@ config NVME_MULTIPATH
 	   subsystems.  If this option is enabled only a single
 	   /dev/nvmeXnY device will show up for each NVMe namespace,
 	   even if it is accessible through multiple controllers.
+       This option must be enabled to allow sharing of namespaces.
+       among multiple controllers.
 
 config NVME_VERBOSE_ERRORS
 	bool "NVMe verbose error reporting"
Signature · 1 line
2.40.1
author
#2 lore raw

PATCH 2/3 nvme-core: exit scan if shared ns but no multipath

In reply to Irvin Cote

If a shared namespace is found during a scan but with multipathing not enabled, inform the user that the driver must be built with CONFIG_NVME_MULTIPATH and exit.

---
 drivers/nvme/host/core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/nvme/host/core.c +4 -3
index 2f89477e4878..6aa160529887 100644
@@ -3565,10 +3565,11 @@ static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)
 
 		if (!multipath) {
 			dev_warn(ctrl->device,
-				"Found shared namespace %d, but multipathing not supported.\n",
+				"Found shared namespace %d, but multipathing not supported.
+				 Enable CONFIG_BLK_MULTIPATH when building to support
+				 shared namespaces\n",
 				info->nsid);
-			dev_warn_once(ctrl->device,
-				"Support for shared namespaces without CONFIG_NVME_MULTIPATH is deprecated and will be removed in Linux 6.0\n.");
+			goto out_put_ns_head;
 		}
 	}
 
Signature · 1 line
2.40.1
author
#3 lore raw

PATCH 3/3 nvme-core: changing comment on disk names in nvme_alloc_ns

In reply to Irvin Cote

The comment was mentioning the name of shared namespaces when multipathing wasn't enabled, but we don't support shared namespaces without multipathing anymore.

---
 drivers/nvme/host/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/nvme/host/core.c +2 -3
index 6aa160529887..197a30a59c99 100644
@@ -3661,9 +3661,8 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, struct nvme_ns_info *info)
 	 * namespaces could lead to naming collisions between shared and private
 	 * namespaces if they don't use a common numbering scheme.
 	 *
-	 * If multipathing is not enabled, disk names must use the controller
-	 * instance as shared namespaces will show up as multiple block
-	 * devices.
+	 * If multipathing is not enabled, we only have private namespaces and
+	 * disk names use the controller instance.
 	 */
 	if (ns->head->disk) {
 		sprintf(disk->disk_name, "nvme%dc%dn%d", ctrl->subsys->instance,
Signature · 1 line
2.40.1