]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.12/nfsd-ensure-sockets-are-closed-on-error.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.12 / nfsd-ensure-sockets-are-closed-on-error.patch
CommitLineData
a709ecc8
GKH
1From 301e99ce4a2f42a317129230fd42e6cd874c64b0 Mon Sep 17 00:00:00 2001
2From: Neil Brown <neilb@suse.de>
3Date: Sun, 28 Feb 2010 22:01:05 -0500
4Subject: nfsd: ensure sockets are closed on error
5
6From: Neil Brown <neilb@suse.de>
7
8commit 301e99ce4a2f42a317129230fd42e6cd874c64b0 upstream.
9
10One the changes in commit d7979ae4a "svc: Move close processing to a
11single place" is:
12
13 err_delete:
14- svc_delete_socket(svsk);
15+ set_bit(SK_CLOSE, &svsk->sk_flags);
16 return -EAGAIN;
17
18This is insufficient. The recvfrom methods must always call
19svc_xprt_received on completion so that the socket gets re-queued if
20there is any more work to do. This particular path did not make that
21call because it actually destroyed the svsk, making requeue pointless.
22When the svc_delete_socket was change to just set a bit, we should have
23added a call to svc_xprt_received,
24
25This is the problem that b0401d7253 attempted to fix, incorrectly.
26
27Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
28Signed-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 }