[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<TYWPR01MB120859EC748253B757BC413AAE6D72@TYWPR01MB12085.jpnprd01.prod.outlook.com>
Date: Thu, 27 Jun 2024 02:57:27 +0000
From: "Hanxiao Chen (Fujitsu)" <chenhx.fnst@...itsu.com>
To: Julian Anastasov <ja@....bg>
CC: Simon Horman <horms@...ge.net.au>, Pablo Neira Ayuso
<pablo@...filter.org>, Jozsef Kadlecsik <kadlec@...filter.org>, "David S .
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub
Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"lvs-devel@...r.kernel.org" <lvs-devel@...r.kernel.org>,
"netfilter-devel@...r.kernel.org" <netfilter-devel@...r.kernel.org>
Subject:
回复: [PATCH net-next] ipvs: properly dereference pe in ip_vs_add_service
> -----邮件原件-----
> 发件人: Julian Anastasov <ja@....bg>
> 发送时间: 2024年6月27日 1:54
> 收件人: Chen, Hanxiao<chenhx.fnst@...itsu.com>
> 抄送: Simon Horman <horms@...ge.net.au>; Pablo Neira Ayuso
> <pablo@...filter.org>; Jozsef Kadlecsik <kadlec@...filter.org>; David S . Miller
> <davem@...emloft.net>; Eric Dumazet <edumazet@...gle.com>; Jakub
> Kicinski <kuba@...nel.org>; Paolo Abeni <pabeni@...hat.com>;
> netdev@...r.kernel.org; lvs-devel@...r.kernel.org;
> netfilter-devel@...r.kernel.org
> 主题: Re: [PATCH net-next] ipvs: properly dereference pe in ip_vs_add_service
>
>
> Hello,
>
> On Wed, 26 Jun 2024, Chen Hanxiao wrote:
>
> > Use rcu_dereference_protected to resolve sparse warning:
> >
> > net/netfilter/ipvs/ip_vs_ctl.c:1471:27: warning: dereference of noderef
> expression
> >
> > Fixes: 39b972231536 ("ipvs: handle connections started by real-servers")
> > Signed-off-by: Chen Hanxiao <chenhx.fnst@...itsu.com>
> > ---
...
> > - if (svc->pe && svc->pe->conn_out)
> > + tmp_pe = rcu_dereference_protected(svc->pe, 1);
> > + if (tmp_pe && tmp_pe->conn_out)
> > atomic_inc(&ipvs->conn_out_counter);
>
> Alternative option would be to use 'pe' above and to move
> the RCU_INIT_POINTER and pe = NULL with their comment here.
> It is up to you to decide which option is better...
>
Thanks for the advice.
Using pe instead of RCU dereference looks like a better choice.
v2 will come soon.
Regards,
- Chen
Powered by blists - more mailing lists