Skip to content

nvmet: add namespace-level debugfs for reservation state

Guixin Liu linux-nvme 2 versions – Applied

Status from this message: Thanks, applied to nvme-7.3.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 3 repliesApplied
  2. v12 patches 7 repliesSuperseded

Changes in v2 from the cover letter

- Switch the output to a "key=value" line format so it is easier to parse from scripts (Daniel Wagner).
- Emit the registrant list as repeated "reg=" lines instead of a "registrants:" header with indented entries.
- Print the holder as "holder=<uuid>,0x<rkey>" and report an empty holder/rtype as "none".
- Stringify notify_mask as a comma-separated list of masked notification names (reg_preempted, resv_released, resv_preempted) instead of a raw hex bitmask; empty mask is reported as "none".
- When reservation is not enabled, print only "enable=0".

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2nvmet: add namespace-level debugfs directorydrivers/nvme/target/core.c drivers/nvme/target/debugfs.c drivers/nvme/target/debugfs.h +1 more+31 -00 replies
2/2nvmet: expose reservation state through debugfsdrivers/nvme/target/debugfs.c+82 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchChristoph HellwigDaniel Wagner
SeriesR-b R-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] nvmet: add namespace-level debugfs for reservation state

This series adds debugfs support for inspecting NVMe target reservation (PR) state at the namespace level.

Patch 1 introduces per-namespace debugfs directories under each subsystem, providing the infrastructure for namespace-specific debug entries.

Patch 2 adds a 'reservation' file that exposes the persistent reservation state including enable status, generation counter, notification mask, holder information, and the full registrant list.

Example output with two registered hosts and an active holder:

  $ cat /sys/kernel/debug/nvmet/testnqn/ns1/reservation
  enable=1
  generation=2
  notify_mask=reg_preempted,resv_released,resv_preempted
  rtype=write_exclusive
  holder=11111111-1111-1111-1111-111111111111,0x1111
  reg=11111111-1111-1111-1111-111111111111,0x1111
  reg=22222222-2222-2222-2222-222222222222,0x2222

v1->v2:
- Switch the output to a "key=value" line format so it is easier to parse from scripts (Daniel Wagner).
- Emit the registrant list as repeated "reg=" lines instead of a "registrants:" header with indented entries.
- Print the holder as "holder=<uuid>,0x<rkey>" and report an empty holder/rtype as "none".
- Stringify notify_mask as a comma-separated list of masked notification names (reg_preempted, resv_released, resv_preempted) instead of a raw hex bitmask; empty mask is reported as "none".
- When reservation is not enabled, print only "enable=0".

Guixin Liu (2):
nvmet: add namespace-level debugfs directory
nvmet: expose reservation state through debugfs

 drivers/nvme/target/core.c    |   2 +
 drivers/nvme/target/debugfs.c | 103 ++++++++++++++++++++++++++++++++++
 drivers/nvme/target/debugfs.h |   5 ++
 drivers/nvme/target/nvmet.h   |   3 +
 4 files changed, 113 insertions(+)
Signature · 1 line
2.43.7