From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <chuck.lever@oracle.com>, NeilBrown <neil@brown.name>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Jeff Layton <jlayton@kernel.org>
Subject: [PATCH 3/4] nfsd: check delegation status in nfsd4_cb_notify_done
Date: Sat, 23 May 2026 12:17:36 -0400 [thread overview]
Message-ID: <20260523-dir-deleg-fixes-v1-3-142c884f85ce@kernel.org> (raw)
In-Reply-To: <20260523-dir-deleg-fixes-v1-0-142c884f85ce@kernel.org>
If a delegation has been closed or revoked (sc_status is set), the
NFS4ERR_DELAY retry loop in nfsd4_cb_notify_done will spin
indefinitely. This holds the sc_count reference and prevents the
delegation from being freed.
Add a check for sc_status at the top of the function, matching the
pattern used in nfsd4_cb_recall_done, to terminate the callback
promptly when the delegation is no longer valid.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
fs/nfsd/nfs4state.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index acddd55a99d8..5e391f01d753 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3593,6 +3593,9 @@ nfsd4_cb_notify_done(struct nfsd4_callback *cb,
struct nfsd4_cb_notify *ncn = container_of(cb, struct nfsd4_cb_notify, ncn_cb);
struct nfs4_delegation *dp = container_of(ncn, struct nfs4_delegation, dl_cb_notify);
+ if (dp->dl_stid.sc_status)
+ return 1;
+
switch (task->tk_status) {
case -NFS4ERR_DELAY:
rpc_delay(task, 2 * HZ);
--
2.54.0
next prev parent reply other threads:[~2026-05-23 16:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-23 16:17 [PATCH 0/4] nfsd: follow-on fixes for directory delegations Jeff Layton
2026-05-23 16:17 ` [PATCH 1/4] nfsd: check for FILEID_INVALID in setup_notify_fhandle Jeff Layton
2026-05-23 16:17 ` [PATCH 2/4] nfsd: use empty string for directory name in NOTIFY4_CHANGE_DIR_ATTRS Jeff Layton
2026-05-23 16:17 ` Jeff Layton [this message]
2026-05-23 16:17 ` [PATCH 4/4] nfsd: fix ino_t format specifier in nfsd_handle_dir_event tracepoint Jeff Layton
2026-05-24 12:09 ` Jeff Layton
2026-05-24 17:44 ` Chuck Lever
2026-05-23 17:00 ` [PATCH 0/4] nfsd: follow-on fixes for directory delegations Chuck Lever
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=20260523-dir-deleg-fixes-v1-3-142c884f85ce@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=chuck.lever@oracle.com \
--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
all inboxes | Powered by JetHome®