Skip to content

Commit

Permalink
SUNRPC: Don't force a redundant disconnection in xs_read_stream()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust committed Dec 5, 2018
1 parent dfcf038 commit 7946285
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,13 +634,7 @@ xs_read_stream(struct sock_xprt *transport, int flags)
transport->recv.len = 0;
return read;
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)
Expand Down

0 comments on commit 7946285

Please sign in to comment.