提交 2199700f 编写于 作者: T Trond Myklebust

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: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 58eaab93
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册