[PATCH v5 1/1] nvme-multipath: expose path_state via sysfs

Keith Busch kbusch at kernel.org
Tue Sep 22 08:03:45 PDT 2026


On Sun, Sep 20, 2026 at 10:52:14AM +0800, Guixin Liu wrote:
> Add a read-only "path_state" sysfs attribute to each NVMe path namespace
> device (/sys/class/nvme/nvmeX/nvmeXcYnZ/path_state) that exposes the
> current path state, including whether the path is enabled or disabled
> with a specific reason.
> 
> Factor the path disable checks from nvme_path_is_disabled() into a new
> nvme_path_get_state() helper that returns an enum nvme_path_state. This
> keeps the path selection logic and sysfs reporting in sync, so any future
> updates to the path disable criteria are automatically reflected in the
> sysfs output.
> 
> Possible values:
>   - "enabled"      : path is usable for I/O
>   - "ctrl-down"    : controller is not live
>   - "ana-pending"  : ANA state change pending
>   - "ns-not-ready" : namespace is not ready
> 
> This gives userspace visibility into the multipath path selection state
> without requiring users to piece together controller state and namespace
> flags manually.

Thanks, applied to nvme-7.4.



More information about the Linux-nvme mailing list