SUNRPC: Prevent SYN+SYNACK+RST storms
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 30 Aug 2015 02:11:21 +0000 (19:11 -0700)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 30 Aug 2015 02:11:21 +0000 (19:11 -0700)
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 <trond.myklebust@primarydata.com>
net/sunrpc/xprtsock.c

index 214ca9dfb14ec7addc07f79cf31f98822fc91f58..7be90bc1a7c26c2c4b998e4b21ca319df19f9638 100644 (file)
@@ -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;