[PATCH] nvme: remove multipath module parameter

John Meneghini jmeneghi at redhat.com
Tue Feb 18 06:05:37 PST 2025


On 2/18/25 3:19 AM, Sagi Grimberg wrote:
>> We can send send a separate patch to address that problem, but this patch, which simply removes the nvme_core.multipath parameter
>> has beeen fully tested and is ready to go.
> 
> I think that we want to print a warning in this case though. Can you resubmit with logging a warning in this case?

Agreed, but I was thinking that warning should go into the second patch. The second patch should disable all secondary paths when
CONFIG_NVME_MULTPATH=N and a namespace is discovered with NMIC enabled. Basically, we don't want to instantiate more than one
namespace when CONFIG_NVME_MULTPATH=N.

But if you want to add a warning to this patch, we could do something like this:

@@ -3909,16 +3909,23 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, struct nvme_ns_info *info)
                 disk->flags |= GENHD_FL_HIDDEN;
         } else {
  #ifdef CONFIG_NVME_MULTIPATH
                 sprintf(disk->disk_name, "nvme%dn%d", ctrl->subsys->instance,
                         ns->head->instance);
  #else
                 sprintf(disk->disk_name, "nvme%dn%d", ctrl->instance,
                         ns->head->instance);
+               if (info->is_shared) {
+                       dev_warn(ctrl->device,
+                               "Found shared namespace %d but multipathing not supported.\n",
+                               info->nsid);
+                       dev_warn_one(ctrl->device,
+                               "Shared namepaces without CONFIG_NVME_MULTIPATH=Y is not supported.\n")
+               }
  #endif
         }

         if (nvme_update_ns_info(ns, info))
                 goto out_unlink_ns;





More information about the Linux-nvme mailing list