Skip to content

Commit

Permalink
NLM: nlm_alloc_call should not immediately fail on signal
Browse files Browse the repository at this point in the history
Currently, nlm_alloc_call tests for a signal before it even tries to
allocate memory.
Fix it so that it tries at least once.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Mar 20, 2006
1 parent 47831f3 commit 36943fa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fs/lockd/clntproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,15 @@ nlmclnt_alloc_call(void)
{
struct nlm_rqst *call;

while (!signalled()) {
call = (struct nlm_rqst *) kmalloc(sizeof(struct nlm_rqst), GFP_KERNEL);
if (call) {
memset(call, 0, sizeof(*call));
for(;;) {
call = kzalloc(sizeof(*call), GFP_KERNEL);
if (call != NULL) {
locks_init_lock(&call->a_args.lock.fl);
locks_init_lock(&call->a_res.lock.fl);
return call;
}
if (signalled())
break;
printk("nlmclnt_alloc_call: failed, waiting for memory\n");
schedule_timeout_interruptible(5*HZ);
}
Expand Down

0 comments on commit 36943fa

Please sign in to comment.