From: Frank Sorenson <sorenson@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: steved@redhat.com, achillesgaikwad@gmail.com, kennethdsouza94@gmail.com
Subject: [PATCH] nfsdclnts: fix display of stateids where the kernel doesn't provide the superblock
Date: Fri, 27 Feb 2026 16:08:41 -0600 [thread overview]
Message-ID: <20260227220841.3015642-1-sorenson@redhat.com> (raw)
If the stateid's file can't be found, the kernel will skip printing
the superblock and filename in the 'states' procfile. When this
happens, nfsdclnts crashes trying to reference the non-existent
superblock key while getting the inode.
Fix this by setting the inode field to 'N/A' when the superblock
isn't present, as is done with other fields which may be missing.
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
---
tools/nfsdclnts/nfsdclnts.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/nfsdclnts/nfsdclnts.py b/tools/nfsdclnts/nfsdclnts.py
index b7280f2c..183a02ee 100755
--- a/tools/nfsdclnts/nfsdclnts.py
+++ b/tools/nfsdclnts/nfsdclnts.py
@@ -87,7 +87,10 @@ def printer(data_list, argument):
client_info = file_to_dict(client_info_path)
for i in data_list:
for key in i:
- inode = i[key]['superblock'].split(':')[-1]
+ try:
+ inode = i[key]['superblock'].split(':')[-1]
+ except:
+ inode = 'N/A'
# The ip address is quoted, so we dequote it.
try:
client_ip = client_info['address'][1:-1]
--
2.52.0
next reply other threads:[~2026-02-27 22:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 22:08 Frank Sorenson [this message]
2026-03-06 22:11 ` [PATCH] nfsdclnts: fix display of stateids where the kernel doesn't provide the superblock Steve Dickson
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=20260227220841.3015642-1-sorenson@redhat.com \
--to=sorenson@redhat.com \
--cc=achillesgaikwad@gmail.com \
--cc=kennethdsouza94@gmail.com \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.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