On Thu, 2018-05-10 at 06:12 +0000, Vallish Vaidyeshwara wrote: > Server initiated socket close can corrupt connection state tracking > table in conjunction with other network middle boxes. In situations > like these, client connection hangs till connection state tracking > table entries age out and get purged. Client reconnection with a new > port in such a situation will avoid connection hang. > > Reviewed-by: Jacob Strauss <jsstraus@xxxxxxxxxx> > Reviewed-by: Alakesh Haloi <alakeshh@xxxxxxxxxx> > Signed-off-by: Vallish Vaidyeshwara <vallish@xxxxxxxxxx> > --- > net/sunrpc/xprtsock.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c > index 5bf75b3..d293c8d 100644 > --- a/net/sunrpc/xprtsock.c > +++ b/net/sunrpc/xprtsock.c > @@ -1629,6 +1629,8 @@ static void xs_tcp_state_change(struct sock > *sk) > /* The server initiated a shutdown of the socket */ > xprt->connect_cookie++; > clear_bit(XPRT_CONNECTED, &xprt->state); > + /* Server sent FIN, reconnect with a new port */ > + transport->srcport = 0; > xs_tcp_force_close(xprt); > /* fall through */ > case TCP_CLOSING: > @@ -1650,6 +1652,9 @@ static void xs_tcp_state_change(struct sock > *sk) > &transport->sock_state)) > xprt_clear_connecting(xprt); > clear_bit(XPRT_CLOSING, &xprt->state); > + /* Server sent RST, reconnect with a new port */ > + if (sk->sk_err == ECONNRESET) > + transport->srcport = 0; > if (sk->sk_err) > xprt_wake_pending_tasks(xprt, -sk->sk_err); > /* Trigger the socket release */ NACK. This will utterly break NFSv2, NFSv3 and NFSv4.0 duplicate replay cache semantics. Cheers Trond -- Trond Myklebust Linux NFS client maintainer, Hammerspace trond.myklebust@xxxxxxxxxxxxxxx ��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥