mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 22:42:10 +00:00
SUNRPC: Fix up missing BKL in asynchronous RPC callback functions
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
3e32a5d99a
commit
bbd5a1f9fc
3 changed files with 13 additions and 6 deletions
|
@ -252,6 +252,7 @@ void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt,
|
||||||
void rpc_put_task(struct rpc_task *);
|
void rpc_put_task(struct rpc_task *);
|
||||||
void rpc_release_task(struct rpc_task *);
|
void rpc_release_task(struct rpc_task *);
|
||||||
void rpc_exit_task(struct rpc_task *);
|
void rpc_exit_task(struct rpc_task *);
|
||||||
|
void rpc_release_calldata(const struct rpc_call_ops *, void *);
|
||||||
void rpc_killall_tasks(struct rpc_clnt *);
|
void rpc_killall_tasks(struct rpc_clnt *);
|
||||||
int rpc_execute(struct rpc_task *);
|
int rpc_execute(struct rpc_task *);
|
||||||
void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *);
|
void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *);
|
||||||
|
|
|
@ -541,8 +541,7 @@ rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, int flags,
|
||||||
rpc_restore_sigmask(&oldset);
|
rpc_restore_sigmask(&oldset);
|
||||||
return status;
|
return status;
|
||||||
out_release:
|
out_release:
|
||||||
if (tk_ops->rpc_release != NULL)
|
rpc_release_calldata(tk_ops, data);
|
||||||
tk_ops->rpc_release(data);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -608,6 +608,15 @@ void rpc_exit_task(struct rpc_task *task)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(rpc_exit_task);
|
EXPORT_SYMBOL(rpc_exit_task);
|
||||||
|
|
||||||
|
void rpc_release_calldata(const struct rpc_call_ops *ops, void *calldata)
|
||||||
|
{
|
||||||
|
if (ops->rpc_release != NULL) {
|
||||||
|
lock_kernel();
|
||||||
|
ops->rpc_release(calldata);
|
||||||
|
unlock_kernel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the RPC `scheduler' (or rather, the finite state machine).
|
* This is the RPC `scheduler' (or rather, the finite state machine).
|
||||||
*/
|
*/
|
||||||
|
@ -883,8 +892,7 @@ void rpc_put_task(struct rpc_task *task)
|
||||||
}
|
}
|
||||||
if (task->tk_flags & RPC_TASK_DYNAMIC)
|
if (task->tk_flags & RPC_TASK_DYNAMIC)
|
||||||
call_rcu_bh(&task->u.tk_rcu, rpc_free_task);
|
call_rcu_bh(&task->u.tk_rcu, rpc_free_task);
|
||||||
if (tk_ops->rpc_release)
|
rpc_release_calldata(tk_ops, calldata);
|
||||||
tk_ops->rpc_release(calldata);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(rpc_put_task);
|
EXPORT_SYMBOL(rpc_put_task);
|
||||||
|
|
||||||
|
@ -928,8 +936,7 @@ struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags,
|
||||||
struct rpc_task *task;
|
struct rpc_task *task;
|
||||||
task = rpc_new_task(clnt, flags, ops, data);
|
task = rpc_new_task(clnt, flags, ops, data);
|
||||||
if (task == NULL) {
|
if (task == NULL) {
|
||||||
if (ops->rpc_release != NULL)
|
rpc_release_calldata(ops, data);
|
||||||
ops->rpc_release(data);
|
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
}
|
}
|
||||||
atomic_inc(&task->tk_count);
|
atomic_inc(&task->tk_count);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue