<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto">
<div><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">1 авг. 2017 г. 16:50 пользователь Kirill Tkhai <ktkhai@virtuozzo.com> написал:<br type="attribution">
<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><font size="2"><span style="font-size:10pt">
<div>On 01.08.2017 14:16, Stanislav Kinsburskiy wrote:<br>
> SUNRPC task can have no RPC client, but RPC request instead (this is a piece<br>
> of NFSv4.1 callback magic).<br>
> In this case network has be taken from tk->rqstp object.<br>
> <br>
> Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com><br>
> ---<br>
> net/sunrpc/clnt.c | 9 ++++++++-<br>
> 1 file changed, 8 insertions(+), 1 deletion(-)<br>
> <br>
> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c<br>
> index 4a2fe46..e87dc47 100644<br>
> --- a/net/sunrpc/clnt.c<br>
> +++ b/net/sunrpc/clnt.c<br>
> @@ -2625,9 +2625,16 @@ void rpc_task_kill_proc_fini(struct net *net)<br>
> remove_proc_entry("kill-tasks", sn->proc_net_rpc);<br>
> }<br>
> <br>
> +static struct net *rpc_task_net(struct rpc_task *task)<br>
> +{<!-- --><br>
> + if (task->tk_client)<br>
> + return rpc_net_ns(task->tk_client);<br>
> + return task->tk_rqstp->rq_xprt->xprt_net;<br>
> +}<br>
> +<br>
> bool rpc_abort_task(struct rpc_task *task)<br>
> {<!-- --><br>
> - struct net *net = rpc_net_ns(task->tk_client);<br>
> + struct net *net = rpc_task_net(task);<br>
<br>
I have no objections, but just for sure, are there places we also need such changes?<br>
</div>
</span></font></div>
</blockquote>
</div>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">I don't think so.</div>
<div dir="auto">This is my code, and this is a silly mistake.</div>
<div dir="auto"><br>
</div>
<div dir="auto">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><font size="2"><span style="font-size:10pt">
<div><br>
> struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);<br>
> <br>
> if (!sn->kill_tasks)<br>
> <br>
</div>
</span></font></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>