diff options
Diffstat (limited to 'net/sunrpc/sched.c')
-rw-r--r-- | net/sunrpc/sched.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index b1b49edd7c4d..896691afbb1a 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -755,22 +755,20 @@ static void __rpc_execute(struct rpc_task *task) | |||
755 | void (*do_action)(struct rpc_task *); | 755 | void (*do_action)(struct rpc_task *); |
756 | 756 | ||
757 | /* | 757 | /* |
758 | * Execute any pending callback first. | 758 | * Perform the next FSM step or a pending callback. |
759 | * | ||
760 | * tk_action may be NULL if the task has been killed. | ||
761 | * In particular, note that rpc_killall_tasks may | ||
762 | * do this at any time, so beware when dereferencing. | ||
759 | */ | 763 | */ |
760 | do_action = task->tk_callback; | 764 | do_action = task->tk_action; |
761 | task->tk_callback = NULL; | 765 | if (task->tk_callback) { |
762 | if (do_action == NULL) { | 766 | do_action = task->tk_callback; |
763 | /* | 767 | task->tk_callback = NULL; |
764 | * Perform the next FSM step. | ||
765 | * tk_action may be NULL if the task has been killed. | ||
766 | * In particular, note that rpc_killall_tasks may | ||
767 | * do this at any time, so beware when dereferencing. | ||
768 | */ | ||
769 | do_action = task->tk_action; | ||
770 | if (do_action == NULL) | ||
771 | break; | ||
772 | } | 768 | } |
773 | trace_rpc_task_run_action(task->tk_client, task, task->tk_action); | 769 | if (!do_action) |
770 | break; | ||
771 | trace_rpc_task_run_action(task->tk_client, task, do_action); | ||
774 | do_action(task); | 772 | do_action(task); |
775 | 773 | ||
776 | /* | 774 | /* |