Skip to content

Commit

Permalink
SUNRPC: Retry wrap in case of memory allocation failure.
Browse files Browse the repository at this point in the history
 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>
  • Loading branch information
J. Bruce Fields authored and Trond Myklebust committed Oct 19, 2005
1 parent ead5e1c commit f368031
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions net/sunrpc/clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

/*
Expand Down

0 comments on commit f368031

Please sign in to comment.