Browse Source

SUNRPC: Don't force a redundant disconnection in xs_read_stream()

If the connection is broken, then xs_tcp_state_change() will take care
of scheduling the socket close as soon as appropriate. xs_read_stream()
just needs to report the error.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Trond Myklebust 6 years ago
parent
commit
79462857eb
1 changed files with 1 additions and 7 deletions
  1. 1 7
      net/sunrpc/xprtsock.c

+ 1 - 7
net/sunrpc/xprtsock.c

@@ -634,13 +634,7 @@ xs_read_stream(struct sock_xprt *transport, int flags)
 	transport->recv.len = 0;
 	transport->recv.len = 0;
 	return read;
 	return read;
 out_err:
 out_err:
-	switch (ret) {
-	case 0:
-	case -ESHUTDOWN:
-		xprt_force_disconnect(&transport->xprt);
-		return -ESHUTDOWN;
-	}
-	return ret;
+	return ret != 0 ? ret : -ESHUTDOWN;
 }
 }
 
 
 static void xs_stream_data_receive(struct sock_xprt *transport)
 static void xs_stream_data_receive(struct sock_xprt *transport)