Skip to content

Commit

Permalink
SUNRPC: Fix Oops in xs_tcp_send_request() when transport is disconnected
Browse files Browse the repository at this point in the history
If a disconnection occurs while we're trying to reply to a server
callback, then we may end up calling xs_tcp_send_request() with a NULL
value for transport->inet, which trips up the call to
tcp_sock_set_cork().

Fixes: d737e5d ("SUNRPC: Set TCP_CORK until the transmit queue is empty")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
Trond Myklebust committed May 20, 2021
1 parent a421d21 commit d275880
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,8 @@ static int xs_tcp_send_request(struct rpc_rqst *req)
kernel_sock_shutdown(transport->sock, SHUT_RDWR);
return -ENOTCONN;
}
if (!transport->inet)
return -ENOTCONN;

xs_pktdump("packet data:",
req->rq_svec->iov_base,
Expand Down

0 comments on commit d275880

Please sign in to comment.