On 15/05/2026 01:24, Mike Snitzer wrote:
On Tue, Apr 28, 2026 at 11:10:52AM +0000, John Garry wrote:
libmultipath: a generic multipath lib for block drivers
This series introduces libmultipath. It is essentially a refactoring of
NVME multipath support, so we can have a common library to also support
native SCSI multipath.
Much of the code is taken directly from the NVMe multipath code. However,
NVMe specifics are removed. A template structure is provided so the driver
may provide callbacks for driver specifics, like ANA support for NVMe.
Important new structures introduced include:
- mpath_head
These contain much of the multipath-specific functionality from
nvme_ns_head, including a pointer to the gendisk structure and
a path SRCU-based array.
- mpath_device
This is the per-path structure, and contains much the same
multipath-specific functionality in nvme_ns
libmultipath provides functionality for path management, path selection,
data path, and failover handling.
Since the NVMe driver has some code in the sysfs and ioctl handling
which iterate all multipath NSes, functions like mpath_call_for_device()
are added to do the same per-path iteration.
To get upstream this library needs an in-tree consumer. So at the end
of the series, it'd makes sense to include the NVMe and/or SCSI
changes that uses it.
I just sent the SCSI and NVMe series separately. Many devs would find it
off putting to review a series with so patches.