提交 a76580fb 编写于 作者: T Trond Myklebust

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: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 5cc2216d
...@@ -825,9 +825,11 @@ static void __rpc_execute(struct rpc_task *task) ...@@ -825,9 +825,11 @@ static void __rpc_execute(struct rpc_task *task)
*/ */
void rpc_execute(struct rpc_task *task) void rpc_execute(struct rpc_task *task)
{ {
bool is_async = RPC_IS_ASYNC(task);
rpc_set_active(task); rpc_set_active(task);
rpc_make_runnable(task); rpc_make_runnable(task);
if (!RPC_IS_ASYNC(task)) if (!is_async)
__rpc_execute(task); __rpc_execute(task);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册