]>
Commit | Line | Data |
---|---|---|
a709ecc8 GKH |
1 | From 301e99ce4a2f42a317129230fd42e6cd874c64b0 Mon Sep 17 00:00:00 2001 |
2 | From: Neil Brown <neilb@suse.de> | |
3 | Date: Sun, 28 Feb 2010 22:01:05 -0500 | |
4 | Subject: nfsd: ensure sockets are closed on error | |
5 | ||
6 | From: Neil Brown <neilb@suse.de> | |
7 | ||
8 | commit 301e99ce4a2f42a317129230fd42e6cd874c64b0 upstream. | |
9 | ||
10 | One the changes in commit d7979ae4a "svc: Move close processing to a | |
11 | single place" is: | |
12 | ||
13 | err_delete: | |
14 | - svc_delete_socket(svsk); | |
15 | + set_bit(SK_CLOSE, &svsk->sk_flags); | |
16 | return -EAGAIN; | |
17 | ||
18 | This is insufficient. The recvfrom methods must always call | |
19 | svc_xprt_received on completion so that the socket gets re-queued if | |
20 | there is any more work to do. This particular path did not make that | |
21 | call because it actually destroyed the svsk, making requeue pointless. | |
22 | When the svc_delete_socket was change to just set a bit, we should have | |
23 | added a call to svc_xprt_received, | |
24 | ||
25 | This is the problem that b0401d7253 attempted to fix, incorrectly. | |
26 | ||
27 | Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> | |
28 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
29 | ||
30 | --- | |
31 | net/sunrpc/svcsock.c | 1 + | |
32 | 1 file changed, 1 insertion(+) | |
33 | ||
34 | --- a/net/sunrpc/svcsock.c | |
35 | +++ b/net/sunrpc/svcsock.c | |
36 | @@ -968,6 +968,7 @@ static int svc_tcp_recv_record(struct sv | |
37 | return len; | |
38 | err_delete: | |
39 | set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); | |
40 | + svc_xprt_received(&svsk->sk_xprt); | |
41 | err_again: | |
42 | return -EAGAIN; | |
43 | } |