diff options
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 71d9599b5816..d7ec6132c046 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -1739,14 +1739,10 @@ rpc_xdr_encode(struct rpc_task *task) | |||
1739 | xdr_buf_init(&req->rq_rcv_buf, | 1739 | xdr_buf_init(&req->rq_rcv_buf, |
1740 | req->rq_rbuffer, | 1740 | req->rq_rbuffer, |
1741 | req->rq_rcvsize); | 1741 | req->rq_rcvsize); |
1742 | req->rq_bytes_sent = 0; | ||
1743 | 1742 | ||
1744 | p = rpc_encode_header(task); | 1743 | p = rpc_encode_header(task); |
1745 | if (p == NULL) { | 1744 | if (p == NULL) |
1746 | printk(KERN_INFO "RPC: couldn't encode RPC header, exit EIO\n"); | ||
1747 | rpc_exit(task, -EIO); | ||
1748 | return; | 1745 | return; |
1749 | } | ||
1750 | 1746 | ||
1751 | encode = task->tk_msg.rpc_proc->p_encode; | 1747 | encode = task->tk_msg.rpc_proc->p_encode; |
1752 | if (encode == NULL) | 1748 | if (encode == NULL) |
@@ -1771,10 +1767,17 @@ call_encode(struct rpc_task *task) | |||
1771 | /* Did the encode result in an error condition? */ | 1767 | /* Did the encode result in an error condition? */ |
1772 | if (task->tk_status != 0) { | 1768 | if (task->tk_status != 0) { |
1773 | /* Was the error nonfatal? */ | 1769 | /* Was the error nonfatal? */ |
1774 | if (task->tk_status == -EAGAIN || task->tk_status == -ENOMEM) | 1770 | switch (task->tk_status) { |
1771 | case -EAGAIN: | ||
1772 | case -ENOMEM: | ||
1775 | rpc_delay(task, HZ >> 4); | 1773 | rpc_delay(task, HZ >> 4); |
1776 | else | 1774 | break; |
1775 | case -EKEYEXPIRED: | ||
1776 | task->tk_action = call_refresh; | ||
1777 | break; | ||
1778 | default: | ||
1777 | rpc_exit(task, task->tk_status); | 1779 | rpc_exit(task, task->tk_status); |
1780 | } | ||
1778 | return; | 1781 | return; |
1779 | } | 1782 | } |
1780 | 1783 | ||
@@ -2336,7 +2339,8 @@ rpc_encode_header(struct rpc_task *task) | |||
2336 | *p++ = htonl(clnt->cl_vers); /* program version */ | 2339 | *p++ = htonl(clnt->cl_vers); /* program version */ |
2337 | *p++ = htonl(task->tk_msg.rpc_proc->p_proc); /* procedure */ | 2340 | *p++ = htonl(task->tk_msg.rpc_proc->p_proc); /* procedure */ |
2338 | p = rpcauth_marshcred(task, p); | 2341 | p = rpcauth_marshcred(task, p); |
2339 | req->rq_slen = xdr_adjust_iovec(&req->rq_svec[0], p); | 2342 | if (p) |
2343 | req->rq_slen = xdr_adjust_iovec(&req->rq_svec[0], p); | ||
2340 | return p; | 2344 | return p; |
2341 | } | 2345 | } |
2342 | 2346 | ||