diff options
author | Neil Brown <neilb@suse.de> | 2010-02-28 22:01:05 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2010-02-28 23:21:51 -0500 |
commit | 301e99ce4a2f42a317129230fd42e6cd874c64b0 (patch) | |
tree | 5522f3410f486fa34dcc64f2374acf029e173244 /net/sunrpc | |
parent | 1b644b6e6f6160ae35ce4b52c2ca89ed3e356e18 (diff) |
nfsd: ensure sockets are closed on error
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>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | 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 9e093910c479..a29f259204e6 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) | |||
968 | return len; | 968 | return len; |
969 | err_delete: | 969 | err_delete: |
970 | set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); | 970 | set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); |
971 | svc_xprt_received(&svsk->sk_xprt); | ||
971 | err_again: | 972 | err_again: |
972 | return -EAGAIN; | 973 | return -EAGAIN; |
973 | } | 974 | } |