Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Guixin Liu <kanie@linux.alibaba.com>
To: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	Hannes Reinecke <hare@suse.com>, Daniel Wagner <dwagner@suse.de>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: linux-nvme@lists.infradead.org, xlpang@linux.alibaba.com,
	oliver.yang@linux.alibaba.com
Subject: [PATCH v2 0/2] nvmet: add namespace-level debugfs for reservation state
Date: Tue,  7 Jul 2026 20:11:12 +0800	[thread overview]
Message-ID: <20260707121114.2273629-1-kanie@linux.alibaba.com> (raw)

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(+)

-- 
2.43.7



             reply	other threads:[~2026-07-07 12:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07 12:11 Guixin Liu [this message]
2026-07-07 12:11 ` [PATCH v2 1/2] nvmet: add namespace-level debugfs directory Guixin Liu
2026-07-07 12:11 ` [PATCH v2 2/2] nvmet: expose reservation state through debugfs Guixin Liu
2026-07-09  5:57 ` [PATCH v2 0/2] nvmet: add namespace-level debugfs for reservation state Christoph Hellwig
2026-07-09 13:15 ` Daniel Wagner
2026-07-09 17:12 ` Keith Busch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260707121114.2273629-1-kanie@linux.alibaba.com \
    --to=kanie@linux.alibaba.com \
    --cc=dwagner@suse.de \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=oliver.yang@linux.alibaba.com \
    --cc=sagi@grimberg.me \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=xlpang@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox