summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields2005-10-13 22:54:48 +0200
committerTrond Myklebust2005-10-19 08:19:43 +0200
commitf3680312a737355ddf35c1b68af25e384d7ef0a8 (patch)
tree6b447f0a58bf1c1acfa8b1731ef06580d275b983
parentSUNRPC: Provide a callback to allow free pages allocated during xdr encoding (diff)
downloadkernel-qcow2-linux-f3680312a737355ddf35c1b68af25e384d7ef0a8.tar.gz
kernel-qcow2-linux-f3680312a737355ddf35c1b68af25e384d7ef0a8.tar.xz
kernel-qcow2-linux-f3680312a737355ddf35c1b68af25e384d7ef0a8.zip
SUNRPC: Retry wrap in case of memory allocation failure.
For privacy we need to allocate extra pages to hold encrypted page data when wrapping requests. This allocation may fail, and we handle that case by waiting and retrying. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--net/sunrpc/clnt.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 534274056329..702ede309b06 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -710,9 +710,16 @@ call_encode(struct rpc_task *task)
rpc_exit(task, -EIO);
return;
}
- if (encode != NULL)
- task->tk_status = rpcauth_wrap_req(task, encode, req, p,
- task->tk_msg.rpc_argp);
+ if (encode == NULL)
+ return;
+
+ task->tk_status = rpcauth_wrap_req(task, encode, req, p,
+ task->tk_msg.rpc_argp);
+ if (task->tk_status == -ENOMEM) {
+ /* XXX: Is this sane? */
+ rpc_delay(task, 3*HZ);
+ task->tk_status = -EAGAIN;
+ }
}
/*