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

Irvin Cote
2023-05-30T22:27:28Z

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.

Signed-off-by: Irvin Cote <irvincoteg@gmail.com>
---
drivers/nvme/host/core.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 2f89477e4878..6aa160529887 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -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;
}
}

--
2.40.1