linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Olga Kornievskaia <olga.kornievskaia@gmail.com>
To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 1/1] SUNRPC: fix handling of half-closed connection
Date: Wed, 20 Feb 2019 09:56:50 -0500	[thread overview]
Message-ID: <20190220145650.21566-1-olga.kornievskaia@gmail.com> (raw)

From: Olga Kornievskaia <kolga@netapp.com>

When server replies with an ACK to client's FIN/ACK, client ends
up stuck in a TCP_FIN_WAIT2 state and client's mount hangs.
Instead, make sure to close and reset client's socket and transport
when transitioned into that state.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 net/sunrpc/xprtsock.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 618e9c2..812e5e3 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1502,6 +1502,7 @@ static void xs_tcp_state_change(struct sock *sk)
 		clear_bit(XPRT_CLOSE_WAIT, &xprt->state);
 		smp_mb__after_atomic();
 		break;
+	case TCP_FIN_WAIT2:
 	case TCP_CLOSE_WAIT:
 		/* The server initiated a shutdown of the socket */
 		xprt->connect_cookie++;
@@ -2152,6 +2153,7 @@ static void xs_tcp_shutdown(struct rpc_xprt *xprt)
 		kernel_sock_shutdown(sock, SHUT_RDWR);
 		trace_rpc_socket_shutdown(xprt, sock);
 		break;
+	case TCP_FIN_WAIT2:
 	case TCP_CLOSE:
 	case TCP_TIME_WAIT:
 		xs_reset_transport(transport);
-- 
1.8.3.1


             reply	other threads:[~2019-02-20 14:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20 14:56 Olga Kornievskaia [this message]
2019-02-22 12:12 ` [PATCH 1/1] SUNRPC: fix handling of half-closed connection Dave Wysochanski
2019-02-22 13:45   ` Trond Myklebust
2019-02-22 14:46     ` Olga Kornievskaia
2019-02-22 15:05       ` Trond Myklebust
2019-02-22 15:11         ` Olga Kornievskaia
2019-02-22 15:50           ` Trond Myklebust
2019-02-22 17:02             ` Olga Kornievskaia
2019-02-22 17:09               ` Trond Myklebust
2019-02-22 14:44   ` Olga Kornievskaia
2019-02-22 16:32     ` Dave Wysochanski
2019-02-22 17:10       ` Olga Kornievskaia
2019-02-22 19:17         ` Dave Wysochanski
2019-02-22 20:00           ` Trond Myklebust
2019-02-23 17:31             ` Dave Wysochanski
2019-03-05 17:22             ` Olga Kornievskaia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190220145650.21566-1-olga.kornievskaia@gmail.com \
    --to=olga.kornievskaia@gmail.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).