Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] nvme-multipath: expose path_state via sysfs
@ 2026-07-24  9:00 Guixin Liu
  2026-07-24  9:00 ` [PATCH v4 1/2] " Guixin Liu
  2026-07-24  9:00 ` [PATCH v4 2/2] nvme-multipath: document path_state sysfs attribute Guixin Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Guixin Liu @ 2026-07-24  9:00 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Nilay Shroff, Daniel Wagner, John Garry
  Cc: linux-nvme

This series adds a read-only "path_state" sysfs attribute to each NVMe
multipath path namespace device (/sys/block/nvmeXcYnZ/path_state), giving
userspace visibility into whether a path is currently usable for I/O and,
if not, the reason it is disabled.

Today users have to piece this together from the controller state and
various namespace flags. The new attribute reports the path selection
state directly, and is kept in sync with the path selection logic by
sharing a single nvme_path_get_state() helper.

Patch 1 adds the attribute and the helper; patch 2 documents it in the
stable NVMe sysfs ABI file.

Changes since v3:
- Use single-token sysfs values ("enabled", "ctrl-down", "ana-pending",
  "ns-not-ready") instead of the composite "disabled (reason)" and
  "enabled (optimized)/(non-optimized)" strings, following the sysfs
  convention of exporting one simple value per attribute.
- Drop the "enabled (optimized)" vs "enabled (non-optimized)"
  distinction; the ANA access state is already exposed through the
  existing per-path ana_state attribute.
- Add a second patch documenting path_state in the stable NVMe sysfs
  ABI (Documentation/ABI/stable/sysfs-nvme).

Changes since v2:
- Factor path disable checks into nvme_path_get_state() helper returning
  enum nvme_path_state, and rebuild nvme_path_is_disabled() on top of it
  to keep path selection logic and sysfs reporting in sync. (Nilay Shroff)
- Distinguish "enabled (optimized)" vs "enabled (non-optimized)" based on
  ANA state. (Keith Busch)

Changes since v1:
- Show specific disabled reason instead of just "disabled":
  "disabled (ctrl_down)", "disabled (ana_pending)",
  "disabled (ns_not_ready)". (Nilay Shroff)

Guixin Liu (2):
  nvme-multipath: expose path_state via sysfs
  nvme-multipath: document path_state sysfs attribute

 Documentation/ABI/stable/sysfs-nvme | 21 +++++++++++++
 drivers/nvme/host/multipath.c       | 47 +++++++++++++++++++++++++----
 drivers/nvme/host/nvme.h            |  1 +
 drivers/nvme/host/sysfs.c           |  4 ++-
 4 files changed, 66 insertions(+), 7 deletions(-)


base-commit: 7caaa4120d8dd73bb251410e1d007b4131d024c4
-- 
2.43.7



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-24  9:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24  9:00 [PATCH v4 0/2] nvme-multipath: expose path_state via sysfs Guixin Liu
2026-07-24  9:00 ` [PATCH v4 1/2] " Guixin Liu
2026-07-24  9:00 ` [PATCH v4 2/2] nvme-multipath: document path_state sysfs attribute Guixin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox