diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-11-11 22:18:03 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-12-06 10:46:25 -0500 |
commit | e6b3c4db6fbcd0d33720696f37790d6b8be12313 (patch) | |
tree | 24ad4a93b00ba7236b9a2d896fd6cb59a1dc2334 /net/sunrpc/clnt.c | |
parent | cc4dc59e5580d6c0de1685a25b74d32175f43434 (diff) |
Fix a second potential rpc_wakeup race...
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index dfeea4fea95a..a323abc7ea85 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -466,10 +466,9 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) | |||
466 | 466 | ||
467 | BUG_ON(flags & RPC_TASK_ASYNC); | 467 | BUG_ON(flags & RPC_TASK_ASYNC); |
468 | 468 | ||
469 | status = -ENOMEM; | ||
470 | task = rpc_new_task(clnt, flags, &rpc_default_ops, NULL); | 469 | task = rpc_new_task(clnt, flags, &rpc_default_ops, NULL); |
471 | if (task == NULL) | 470 | if (task == NULL) |
472 | goto out; | 471 | return -ENOMEM; |
473 | 472 | ||
474 | /* Mask signals on RPC calls _and_ GSS_AUTH upcalls */ | 473 | /* Mask signals on RPC calls _and_ GSS_AUTH upcalls */ |
475 | rpc_task_sigmask(task, &oldset); | 474 | rpc_task_sigmask(task, &oldset); |
@@ -478,15 +477,17 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) | |||
478 | 477 | ||
479 | /* Set up the call info struct and execute the task */ | 478 | /* Set up the call info struct and execute the task */ |
480 | status = task->tk_status; | 479 | status = task->tk_status; |
481 | if (status == 0) { | 480 | if (status != 0) { |
482 | atomic_inc(&task->tk_count); | 481 | rpc_release_task(task); |
483 | status = rpc_execute(task); | 482 | goto out; |
484 | if (status == 0) | ||
485 | status = task->tk_status; | ||
486 | } | 483 | } |
487 | rpc_restore_sigmask(&oldset); | 484 | atomic_inc(&task->tk_count); |
488 | rpc_release_task(task); | 485 | status = rpc_execute(task); |
486 | if (status == 0) | ||
487 | status = task->tk_status; | ||
488 | rpc_put_task(task); | ||
489 | out: | 489 | out: |
490 | rpc_restore_sigmask(&oldset); | ||
490 | return status; | 491 | return status; |
491 | } | 492 | } |
492 | 493 | ||