[PATCH V2] nvme: Add module reference counting for multipath devices
Sagi Grimberg
sagi at grimberg.me
Sat Aug 22 17:20:49 PDT 2026
On 13/08/2026 1:32, wenxiong at linux.ibm.com wrote:
> From: Wen Xiong <wenxiong at linux.ibm.com>
>
> Add proper module reference counting to prevent premature unloading of
> NVMe transport modules while multipath namespaces are still active.
>
> When a namespace is added to a multipath device via nvme_mpath_add_disk(),
> the underlying transport module (PCIe, FC, RDMA, TCP, etc.) must remain
> loaded as long as the multipath device references that namespace. Without
> proper reference counting, the transport module could be unloaded while
> the multipath device is still using resources from that module, leading
> to the potential system crashes.
>
> This ensures the transport module remains loaded for the entire lifetime
> of the multipath namespace association.
Can you provide details about the issue that this patch is supposed to
address?
(e.g. potential system crashes). The driver unload should be able to
disconnect all of the connected controllers when tearing down...
More information about the Linux-nvme
mailing list