[PATCH v2 00/13] nvme: switch to libmultipath

John Garry john.g.garry at oracle.com
Tue Apr 28 04:12:43 PDT 2026


This switches the NVMe host driver to use libmultipath. That library
is very heavily based on the NVMe multipath code, so the change over
should hopefully be straightforward. There is often a direct replacement
for functions.

The multipath functionality in nvme_ns_head and nvme_ns structures are
replaced with the mpath_head and mpath_device structures.

It's hard to switch to libmulipath in a step-by-step fashion without
breaking builds or functionality. To make the series reviewable, I took
the approach of adding libmultipath-based code, which would initially be
unused, and then finally making the full switch.

I think that more testing is required here and any help on that would be
appreciated.

The series is based on 8658b6054439 (nvme/nvme-7.1) nvme-auth: Include
SC_C in RVAL controller hash

Full series also available at
https://github.com/johnpgarry/linux/commits/scsi-multipath-pre-7.1-upstream-v2/

Differences to v1 (apart from porting changes for v2 libmultipath):
- always depend on LIBMULTIAPTH and drop nvme_ns_head.ns_count
- add nvme_add_ns() and nvme_delete_ns()
- init .drv_module (Nilay)
- condense code

John Garry (13):
  nvme-multipath: pass NS head to nvme_mpath_revalidate_paths()
  nvme-multipath: add initial support for using libmultipath
  nvme-multipath: add nvme_mpath_available_path()
  nvme-multipath: add nvme_mpath_{add, remove}_cdev()
  nvme-multipath: add nvme_mpath_is_{disabled, optimised}
  nvme-multipath: add nvme_mpath_cdev_ioctl()
  nvme-multipath: add uring_cmd support
  nvme-multipath: add nvme_mpath_get_iopolicy()
  nvme-multipath: add nvme_mpath_synchronize()
  nvme-multipath: add nvme_{add,delete}_ns()
  nvme-multipath: add nvme_mpath_head_queue_if_no_path()
  nvme-multipath: add nvme_mpath_get_nr_active()
  nvme-multipath: switch to use libmultipath

 drivers/nvme/host/Kconfig     |   1 +
 drivers/nvme/host/core.c      |  88 ++--
 drivers/nvme/host/ioctl.c     | 108 ++--
 drivers/nvme/host/multipath.c | 897 +++++++---------------------------
 drivers/nvme/host/nvme.h      | 136 +++---
 drivers/nvme/host/pr.c        |  18 -
 drivers/nvme/host/sysfs.c     |  86 +---
 7 files changed, 337 insertions(+), 997 deletions(-)

-- 
2.43.5




More information about the Linux-nvme mailing list