Skip to content

Commit

Permalink
SUNRPC: Fix buggy UDP transmission
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 9, 2007
1 parent 58eaab9 commit 2199700
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2199700

Please sign in to comment.