From: Trond Myklebust Date: Sun, 30 Aug 2015 02:11:21 +0000 (-0700) Subject: SUNRPC: Prevent SYN+SYNACK+RST storms X-Git-Tag: firefly_0821_release~176^2~1127^2~17 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=099392048cd443349c50310f7fdc96070e40f4e7;p=firefly-linux-kernel-4.4.55.git SUNRPC: Prevent SYN+SYNACK+RST storms Add a shutdown() call before we release the socket in order to ensure the reset is sent before we try to reconnect. Signed-off-by: Trond Myklebust --- diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 214ca9dfb14e..7be90bc1a7c2 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -822,6 +822,8 @@ static void xs_reset_transport(struct sock_xprt *transport) if (atomic_read(&transport->xprt.swapper)) sk_clear_memalloc(sk); + kernel_sock_shutdown(sock, SHUT_RDWR); + write_lock_bh(&sk->sk_callback_lock); transport->inet = NULL; transport->sock = NULL;