aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-07-11 17:48:52 +0200
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-07-27 17:56:57 -0400
commitf580dd042823294b5b548e0f8bf1ba7a4b114fa5 (patch)
tree2cdee234c3eb1ba405ae082d4261d7b445ea4d69 /net/sunrpc
parentsunrpc: translate -EAGAIN to -ENOBUFS when socket is writable. (diff)
downloadlinux-dev-f580dd042823294b5b548e0f8bf1ba7a4b114fa5.tar.xz
linux-dev-f580dd042823294b5b548e0f8bf1ba7a4b114fa5.zip
SUNRPC: Report TCP errors to the caller
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtsock.c13
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)
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;
@@ -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;