From: "J. Bruce Fields" <bfields@citi.umich.edu>
To: stable@kernel.org
Cc: linux-nfs@vger.kernel.org, Neil Brown <neilb@suse.de>,
"J. Bruce Fields" <bfields@citi.umich.edu>
Subject: [PATCH 3/3] nfsd: ensure sockets are closed on error
Date: Wed, 31 Mar 2010 15:34:10 -0400 [thread overview]
Message-ID: <1270064050-5239-3-git-send-email-bfields@citi.umich.edu> (raw)
In-Reply-To: <1270064050-5239-2-git-send-email-bfields@citi.umich.edu>
From: Neil Brown <neilb@suse.de>
One the changes in commit d7979ae4a "svc: Move close processing to a
single place" is:
err_delete:
- svc_delete_socket(svsk);
+ set_bit(SK_CLOSE, &svsk->sk_flags);
return -EAGAIN;
This is insufficient. The recvfrom methods must always call
svc_xprt_received on completion so that the socket gets re-queued if
there is any more work to do. This particular path did not make that
call because it actually destroyed the svsk, making requeue pointless.
When the svc_delete_socket was change to just set a bit, we should have
added a call to svc_xprt_received,
This is the problem that b0401d7253 attempted to fix, incorrectly.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
---
net/sunrpc/svcsock.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 1c246a4..70b0a22 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -968,6 +968,7 @@ static int svc_tcp_recv_record(struct svc_sock *svsk, struct svc_rqst *rqstp)
return len;
err_delete:
set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags);
+ svc_xprt_received(&svsk->sk_xprt);
err_again:
return -EAGAIN;
}
--
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 ` [PATCH 2/3] Revert "sunrpc: move the close processing after do recvfrom method" J. Bruce Fields
2010-03-31 19:34 ` J. Bruce Fields [this message]
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-3-git-send-email-bfields@citi.umich.edu \
--to=bfields@citi.umich.edu \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--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