From: Prabhakar Pujeri <prabhakar.pujeri@dell.com>
To: cel@kernel.org, jlayton@kernel.org
Cc: Prabhakar Pujeri <prabhakar.pujeri@dell.com>,
neil@brown.name, okorniev@redhat.com, Dai.Ngo@oracle.com,
tom@talpey.com, donald.hunter@gmail.com, kuba@kernel.org,
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/2] nfsd: expose NFSv4 client state through Netlink
Date: Mon, 31 Aug 2026 09:27:22 +0000 [thread overview]
Message-ID: <cover.1787988917.git.prabhakar.pujeri@dell.com> (raw)
Administrators can inspect NFSv4 clients through the nfsd filesystem, but
collecting a server-wide view requires walking one directory and opening
multiple files for every client. That interface remains useful for detailed
inspection, but it is awkward for monitoring and automation.
Add a compact, privileged query to the existing nfsd Generic Netlink family:
1. Dump basic NFSv4 client identity, address, lease, confirmation,
reclaim, and callback state.
2. Add O(1) snapshots of per-client session and stateid record counts.
The existing nfsd filesystem files and their output remain unchanged. A
companion nfs-utils v2 series adds `nfsdctl clients`; its cover Message-ID is:
<cover.1787988918.git.prabhakar.pujeri@dell.com>
This reroll intentionally drops the grace-status patch. As discussed with
Chuck, that interface needs an explicitly scoped design that can represent
both current server-wide grace and possible per-export grace in the future.
I will address it in a separate proposal.
Changes since v1:
- replace the raw sockaddr attribute with separate IPv4/IPv6 address,
port, and optional IPv6 scope-ID attributes
- add a nonzero client-table generation and
genl_dump_check_consistent(), so churn marks the dump NLM_F_DUMP_INTR
- replace session-list and stateid-IDR walks under cl_lock with maintained
u64 counters, making every per-client snapshot O(1)
- encode counts as variable-width Netlink uint attributes
- drop the grace-status patch for a separately scoped design
- rebase onto nfsd-testing at 65b583e874b3
Validation performed:
- strict checkpatch on both patches: no errors, warnings, or checks
- YNL regeneration and all 33 schema checks; generated files remained clean
- headers_install and NFS admin-guide and Netlink-spec documentation builds
with SPHINXOPTS=-W
- full x86_64 GCC 16.1.1 kernel/modules build with W=1; no NFSD or
changed-file warnings
- focused NFSD W=1 build and Sparse over every fs/nfsd translation unit:
no findings
- two independent two-vCPU QEMU boots of the exact locally built kernel
- each boot created one live NFSv4.2 client with one session, open stateid,
lock stateid, and delegation stateid, and zero layout stateids
- raw Netlink, nfsdctl, and /proc/fs/nfsd/clients state agreed in both runs
- no kernel warning, Oops, panic, sanitizer report, lockup, or stall
Development assistance: an LLM assisted with review analysis, implementation,
commit-message drafting, and test-harness development; Sparse was used for
static analysis.
Assisted-by: LLM sparse
v1: https://lore.kernel.org/r/cover.1787638668.git.prabhakar.pujeri@dell.com
Prabhakar Pujeri (2):
nfsd: add a Netlink dump of NFSv4 clients
nfsd: report per-client NFSv4 state usage through Netlink
.../admin-guide/nfs/nfsd-admin-interfaces.rst | 22 ++
Documentation/netlink/specs/nfsd.yaml | 118 ++++++
fs/nfsd/netlink.c | 5 +
fs/nfsd/netlink.h | 1 +
fs/nfsd/netns.h | 1 +
fs/nfsd/nfs4ctl.h | 10 +
fs/nfsd/nfs4layouts.c | 2 +-
fs/nfsd/nfs4state.c | 341 +++++++++++++++++-
fs/nfsd/nfsctl.c | 13 +
fs/nfsd/state.h | 7 +
include/uapi/linux/nfsd_netlink.h | 43 +++
11 files changed, 553 insertions(+), 10 deletions(-)
base-commit: 65b583e874b371d539314272006833653364a06b
--
2.54.0
next reply other threads:[~2026-08-31 9:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 9:27 Prabhakar Pujeri [this message]
2026-08-31 9:27 ` [PATCH v2 1/2] nfsd: add a Netlink dump of NFSv4 clients Prabhakar Pujeri
2026-09-01 14:02 ` Jeff Layton
2026-09-03 5:45 ` Prabhakar Pujeri
2026-08-31 9:27 ` [PATCH v2 2/2] nfsd: report per-client NFSv4 state usage through Netlink Prabhakar Pujeri
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=cover.1787988917.git.prabhakar.pujeri@dell.com \
--to=prabhakar.pujeri@dell.com \
--cc=Dai.Ngo@oracle.com \
--cc=cel@kernel.org \
--cc=donald.hunter@gmail.com \
--cc=jlayton@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=tom@talpey.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