summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2010-02-28 22:01:05 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 16:01:35 -0700
commit9cb1043669666d35a3f547b6540d69dc7e4071a8 (patch)
treea220fcb6f9ef12c0634d9f1e877ed55ad2b26d4a /net
parentf3fb6babd4e025fc1c4f00280e7c9486171a920e (diff)
nfsd: ensure sockets are closed on error
commit 301e99ce4a2f42a317129230fd42e6cd874c64b0 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svcsock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 870929e08e5d..528efef3c296 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;
}