summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-01 11:43:37 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:20:37 -0400
commit2199700f1d660494d2552278354422c51becb686 (patch)
tree38a1b9887a515ed67a0f2495770a6c979937548c /net/sunrpc/xprtsock.c
parent58eaab93376cb524fd0f1531a56902d2b3eaa619 (diff)
downloadtalos-obmc-linux-2199700f1d660494d2552278354422c51becb686.tar.gz
talos-obmc-linux-2199700f1d660494d2552278354422c51becb686.zip
SUNRPC: Fix buggy UDP transmission
xs_sendpages() may return a negative result. We sure as hell don't want to add that to the 'tk_bytes_sent' tally... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r--net/sunrpc/xprtsock.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index e97e4ca43ef3..6f32cc57f429 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -587,13 +587,13 @@ static int xs_udp_send_request(struct rpc_task *task)
dprintk("RPC: xs_udp_send_request(%u) = %d\n",
xdr->len - req->rq_bytes_sent, status);
- task->tk_bytes_sent += status;
- if (likely(status >= (int) req->rq_slen))
- return 0;
-
- /* Still some bytes left; set up for a retry later. */
- if (status > 0)
+ if (status >= 0) {
+ task->tk_bytes_sent += status;
+ if (status >= req->rq_slen)
+ return 0;
+ /* Still some bytes left; set up for a retry later. */
status = -EAGAIN;
+ }
switch (status) {
case -ENETUNREACH:
OpenPOWER on IntegriCloud