diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-05-20 23:00:18 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-06-06 16:24:38 -0400 |
commit | a76580fbf09e6e19c2040c08969af5137e064eda (patch) | |
tree | efd3497a42cbf571916ac57037b3b326bbf1fa25 /net/sunrpc | |
parent | 5cc2216db844beac6ce78c3e48137cd58911b297 (diff) |
SUNRPC: Fix a potential race in rpc_execute
If the rpc_task is asynchronous, it could theoretically finish executing
on the workqueue it was assigned by rpc_make_runnable() before we get
round to testing RPC_IS_ASYNC() in rpc_execute.
In practice, however, all the existing callers hold a reference to the
rpc_task, so this can't happen today...
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/sched.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index 5356b120dbf8..849ca413522c 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -825,9 +825,11 @@ static void __rpc_execute(struct rpc_task *task) | |||
825 | */ | 825 | */ |
826 | void rpc_execute(struct rpc_task *task) | 826 | void rpc_execute(struct rpc_task *task) |
827 | { | 827 | { |
828 | bool is_async = RPC_IS_ASYNC(task); | ||
829 | |||
828 | rpc_set_active(task); | 830 | rpc_set_active(task); |
829 | rpc_make_runnable(task); | 831 | rpc_make_runnable(task); |
830 | if (!RPC_IS_ASYNC(task)) | 832 | if (!is_async) |
831 | __rpc_execute(task); | 833 | __rpc_execute(task); |
832 | } | 834 | } |
833 | 835 | ||