From: "J. Bruce Fields" <bfields@citi.umich.edu>
To: stable@kernel.org
Cc: linux-nfs@vger.kernel.org, "J. Bruce Fields" <bfields@citi.umich.edu>
Subject: [PATCH 2/3] Revert "sunrpc: move the close processing after do recvfrom method"
Date: Wed, 31 Mar 2010 15:34:09 -0400 [thread overview]
Message-ID: <1270064050-5239-2-git-send-email-bfields@citi.umich.edu> (raw)
In-Reply-To: <1270064050-5239-1-git-send-email-bfields@citi.umich.edu>
This reverts commit b0401d725334a94d57335790b8ac2404144748ee, which
moved svc_delete_xprt() outside of XPT_BUSY, and allowed it to be called
after svc_xpt_recived(), removing its last reference and destroying it
after it had already been queued for future processing.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
---
net/sunrpc/svc_xprt.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 929f6db..3fbd6ba 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -711,7 +711,10 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
spin_unlock_bh(&pool->sp_lock);
len = 0;
- if (test_bit(XPT_LISTENER, &xprt->xpt_flags)) {
+ if (test_bit(XPT_CLOSE, &xprt->xpt_flags)) {
+ dprintk("svc_recv: found XPT_CLOSE\n");
+ svc_delete_xprt(xprt);
+ } else if (test_bit(XPT_LISTENER, &xprt->xpt_flags)) {
struct svc_xprt *newxpt;
newxpt = xprt->xpt_ops->xpo_accept(xprt);
if (newxpt) {
@@ -737,7 +740,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
svc_xprt_received(newxpt);
}
svc_xprt_received(xprt);
- } else if (!test_bit(XPT_CLOSE, &xprt->xpt_flags)) {
+ } else {
dprintk("svc: server %p, pool %u, transport %p, inuse=%d\n",
rqstp, pool->sp_id, xprt,
atomic_read(&xprt->xpt_ref.refcount));
@@ -750,11 +753,6 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
dprintk("svc: got len=%d\n", len);
}
- if (test_bit(XPT_CLOSE, &xprt->xpt_flags)) {
- dprintk("svc_recv: found XPT_CLOSE\n");
- svc_delete_xprt(xprt);
- }
-
/* No data, incomplete (TCP) read, or accept() */
if (len == 0 || len == -EAGAIN) {
rqstp->rq_res.len = 0;
--
1.6.3.3
next prev parent reply other threads:[~2010-03-31 19:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-06 17:52 nfsd changes for 2.6.34 J. Bruce Fields
2010-03-24 14:24 ` J. Bruce Fields
2010-03-29 18:24 ` [stable] " Greg KH
2010-03-30 14:40 ` J. Bruce Fields
2010-03-30 20:03 ` Greg KH
2010-03-31 19:30 ` J. Bruce Fields
2010-03-31 19:34 ` [PATCH 1/3] Revert "sunrpc: fix peername failed on closed listener" J. Bruce Fields
2010-03-31 19:34 ` J. Bruce Fields [this message]
2010-03-31 19:34 ` [PATCH 3/3] nfsd: ensure sockets are closed on error J. Bruce Fields
2010-03-31 19:47 ` [PATCH] nfsd4: don't try to map gid's in generic rpc code J. Bruce Fields
2010-04-21 22:50 ` [stable] nfsd changes for 2.6.34 Greg KH
2010-04-21 23:41 ` J. Bruce Fields
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=1270064050-5239-2-git-send-email-bfields@citi.umich.edu \
--to=bfields@citi.umich.edu \
--cc=linux-nfs@vger.kernel.org \
--cc=stable@kernel.org \
/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