From: Chuck Lever <cel@kernel.org>
To: NeilBrown <neil@brown.name>, Jeff Layton <jlayton@kernel.org>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: <linux-nfs@vger.kernel.org>, <linux-rdma@vger.kernel.org>
Subject: [PATCH v1 2/5] SUNRPC: fire svc_defer_queue tracepoint before publishing the request
Date: Mon, 21 Sep 2026 21:51:25 -0400 [thread overview]
Message-ID: <20260922015128.240977-2-cel@kernel.org> (raw)
In-Reply-To: <20260922015128.240977-1-cel@kernel.org>
svc_revisit() adds the deferred request to xpt_deferred, drops
xpt_lock, and then fires trace_svc_defer_queue(), which reads the
request's XID and source address. Once the request is on the list,
an nfsd thread already servicing that transport can dequeue it in
svc_deferred_dequeue(), process it, and free it in
svc_xprt_release() before the tracepoint reads it. The window is
narrow, but nothing keeps the request alive across it.
Fire the tracepoint before the list_add(), while svc_revisit()
still owns the request.
Fixes: 8954c5c212d3 ("SUNRPC: Clean up request deferral tracepoints")
Signed-off-by: Chuck Lever <cel@kernel.org>
---
net/sunrpc/svc_xprt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 908569035e57..713f4ba19ba1 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -1271,9 +1271,9 @@ static void svc_revisit(struct cache_deferred_req *dreq, int too_many)
return;
}
dr->xprt = NULL;
+ trace_svc_defer_queue(dr);
list_add(&dr->handle.recent, &xprt->xpt_deferred);
spin_unlock(&xprt->xpt_lock);
- trace_svc_defer_queue(dr);
svc_xprt_enqueue(xprt);
svc_xprt_put(xprt);
}
--
2.55.0
next prev parent reply other threads:[~2026-09-22 1:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 1:51 [PATCH v1 1/5] SUNRPC: fire svc_xprt_free tracepoint before dropping the netns Chuck Lever
2026-09-22 1:51 ` Chuck Lever [this message]
2026-09-22 1:51 ` [PATCH v1 3/5] svcrdma: fix a page leak in backchannel sends Chuck Lever
2026-09-22 1:51 ` [PATCH v1 4/5] svcrdma: release a send context stranded by a partial post Chuck Lever
2026-09-22 1:51 ` [PATCH v1 5/5] svcrdma: release a receive context stranded by a partial Read post 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=20260922015128.240977-2-cel@kernel.org \
--to=cel@kernel.org \
--cc=dai.ngo@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-rdma@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