diff options
| author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-07-11 11:48:52 -0400 |
|---|---|---|
| committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-07-27 17:56:57 -0400 |
| commit | f580dd042823294b5b548e0f8bf1ba7a4b114fa5 (patch) | |
| tree | 2cdee234c3eb1ba405ae082d4261d7b445ea4d69 | |
| parent | 743c69e7c089ba1bea1b207c5829dd079a4e98f9 (diff) | |
SUNRPC: Report TCP errors to the caller
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
| -rw-r--r-- | net/sunrpc/xprtsock.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 4f48b1a19e9f..6a21368bdd8e 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
| @@ -677,9 +677,6 @@ static int xs_tcp_send_request(struct rpc_task *task) | |||
| 677 | dprintk("RPC: xs_tcp_send_request(%u) = %d\n", | 677 | dprintk("RPC: xs_tcp_send_request(%u) = %d\n", |
| 678 | xdr->len - req->rq_bytes_sent, status); | 678 | xdr->len - req->rq_bytes_sent, status); |
| 679 | 679 | ||
| 680 | if (unlikely(sent == 0 && status < 0)) | ||
| 681 | break; | ||
| 682 | |||
| 683 | /* If we've sent the entire packet, immediately | 680 | /* If we've sent the entire packet, immediately |
| 684 | * reset the count of bytes sent. */ | 681 | * reset the count of bytes sent. */ |
| 685 | req->rq_bytes_sent += sent; | 682 | req->rq_bytes_sent += sent; |
| @@ -689,10 +686,12 @@ static int xs_tcp_send_request(struct rpc_task *task) | |||
| 689 | return 0; | 686 | return 0; |
| 690 | } | 687 | } |
| 691 | 688 | ||
| 692 | if (sent != 0) | 689 | if (status < 0) |
| 693 | continue; | 690 | break; |
| 694 | status = -EAGAIN; | 691 | if (sent == 0) { |
| 695 | break; | 692 | status = -EAGAIN; |
| 693 | break; | ||
| 694 | } | ||
| 696 | } | 695 | } |
| 697 | if (status == -EAGAIN && sk_stream_is_writeable(transport->inet)) | 696 | if (status == -EAGAIN && sk_stream_is_writeable(transport->inet)) |
| 698 | status = -ENOBUFS; | 697 | status = -ENOBUFS; |
