[Devel] [PATCH] sunrpc: take net from task client only is available
Stanislav Kinsburskiy
skinsbursky at virtuozzo.com
Tue Aug 1 17:05:19 MSK 2017
1 авг. 2017 г. 16:50 пользователь Kirill Tkhai <ktkhai at virtuozzo.com> написал:
On 01.08.2017 14:16, Stanislav Kinsburskiy wrote:
> SUNRPC task can have no RPC client, but RPC request instead (this is a piece
> of NFSv4.1 callback magic).
> In this case network has be taken from tk->rqstp object.
>
> Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
> ---
> net/sunrpc/clnt.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
> index 4a2fe46..e87dc47 100644
> --- a/net/sunrpc/clnt.c
> +++ b/net/sunrpc/clnt.c
> @@ -2625,9 +2625,16 @@ void rpc_task_kill_proc_fini(struct net *net)
> remove_proc_entry("kill-tasks", sn->proc_net_rpc);
> }
>
> +static struct net *rpc_task_net(struct rpc_task *task)
> +{
> + if (task->tk_client)
> + return rpc_net_ns(task->tk_client);
> + return task->tk_rqstp->rq_xprt->xprt_net;
> +}
> +
> bool rpc_abort_task(struct rpc_task *task)
> {
> - struct net *net = rpc_net_ns(task->tk_client);
> + struct net *net = rpc_task_net(task);
I have no objections, but just for sure, are there places we also need such changes?
I don't think so.
This is my code, and this is a silly mistake.
> struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
>
> if (!sn->kill_tasks)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/devel/attachments/20170801/44aa3136/attachment.html>
More information about the Devel
mailing list