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>
This commit is contained in:
parent
58eaab9337
commit
2199700f1d
1 changed files with 6 additions and 6 deletions
|
@ -587,13 +587,13 @@ static int xs_udp_send_request(struct rpc_task *task)
|
||||||
dprintk("RPC: xs_udp_send_request(%u) = %d\n",
|
dprintk("RPC: xs_udp_send_request(%u) = %d\n",
|
||||||
xdr->len - req->rq_bytes_sent, status);
|
xdr->len - req->rq_bytes_sent, status);
|
||||||
|
|
||||||
task->tk_bytes_sent += status;
|
if (status >= 0) {
|
||||||
if (likely(status >= (int) req->rq_slen))
|
task->tk_bytes_sent += status;
|
||||||
return 0;
|
if (status >= req->rq_slen)
|
||||||
|
return 0;
|
||||||
/* Still some bytes left; set up for a retry later. */
|
/* Still some bytes left; set up for a retry later. */
|
||||||
if (status > 0)
|
|
||||||
status = -EAGAIN;
|
status = -EAGAIN;
|
||||||
|
}
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case -ENETUNREACH:
|
case -ENETUNREACH:
|
||||||
|
|
Loading…
Reference in a new issue