aboutsummaryrefslogtreecommitdiffstats
path: root/net
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
parent58eaab93376cb524fd0f1531a56902d2b3eaa619 (diff)
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')
-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)
587 dprintk("RPC: xs_udp_send_request(%u) = %d\n", 587 dprintk("RPC: xs_udp_send_request(%u) = %d\n",
588 xdr->len - req->rq_bytes_sent, status); 588 xdr->len - req->rq_bytes_sent, status);
589 589
590 task->tk_bytes_sent += status; 590 if (status >= 0) {
591 if (likely(status >= (int) req->rq_slen)) 591 task->tk_bytes_sent += status;
592 return 0; 592 if (status >= req->rq_slen)
593 593 return 0;
594 /* Still some bytes left; set up for a retry later. */ 594 /* Still some bytes left; set up for a retry later. */
595 if (status > 0)
596 status = -EAGAIN; 595 status = -EAGAIN;
596 }
597 597
598 switch (status) { 598 switch (status) {
599 case -ENETUNREACH: 599 case -ENETUNREACH: