Skip to content

Commit

Permalink
SUNRPC: Report TCP errors to the caller
Browse files Browse the repository at this point in the history
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
Trond Myklebust committed Jul 27, 2015
1 parent 743c69e commit f580dd0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,6 @@ static int xs_tcp_send_request(struct rpc_task *task)
dprintk("RPC: xs_tcp_send_request(%u) = %d\n",
xdr->len - req->rq_bytes_sent, status);

if (unlikely(sent == 0 && status < 0))
break;

/* If we've sent the entire packet, immediately
* reset the count of bytes sent. */
req->rq_bytes_sent += sent;
Expand All @@ -689,10 +686,12 @@ static int xs_tcp_send_request(struct rpc_task *task)
return 0;
}

if (sent != 0)
continue;
status = -EAGAIN;
break;
if (status < 0)
break;
if (sent == 0) {
status = -EAGAIN;
break;
}
}
if (status == -EAGAIN && sk_stream_is_writeable(transport->inet))
status = -ENOBUFS;
Expand Down

0 comments on commit f580dd0

Please sign in to comment.