[PATCH v5 1/1] nvme-multipath: expose path_state via sysfs
Nilay Shroff
nilay at linux.ibm.com
Sun Sep 20 03:07:29 PDT 2026
On 9/20/26 8:22 AM, 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.
>
> Signed-off-by: Guixin Liu<kanie at linux.alibaba.com>
Looks good to me.
Reviewed-by: Nilay Shroff <nilay at linux.ibm.com>
More information about the Linux-nvme
mailing list