diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/sched.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index e838d042f7f..d1c8b47f0d0 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -299,13 +299,15 @@ EXPORT_SYMBOL(__rpc_wait_for_completion_task); */ static void rpc_make_runnable(struct rpc_task *task) { - int do_ret; - BUG_ON(task->tk_timeout_fn); - do_ret = rpc_test_and_set_running(task); rpc_clear_queued(task); - if (do_ret) + if (rpc_test_and_set_running(task)) + return; + /* We might have raced */ + if (RPC_IS_QUEUED(task)) { + rpc_clear_running(task); return; + } if (RPC_IS_ASYNC(task)) { int status; |