[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250910170613.GB30363@horms.kernel.org>
Date: Wed, 10 Sep 2025 18:06:13 +0100
From: Simon Horman <horms@...nel.org>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
MD Danish Anwar <danishanwar@...com>,
Alexander Lobakin <aleksander.lobakin@...el.com>,
Jaakko Karrenpalo <jkarrenpalo@...il.com>,
Fernando Fernandez Mancera <ffmancera@...eup.net>,
Murali Karicheri <m-karicheri2@...com>,
WingMan Kwok <w-kwok2@...com>, Stanislav Fomichev <sdf@...ichev.me>,
Xiao Liang <shaw.leon@...il.com>,
Kuniyuki Iwashima <kuniyu@...gle.com>,
Johannes Berg <johannes.berg@...el.com>
Subject: Re: [PATCHv3 net 1/3] hsr: use rtnl lock when iterating over ports
On Fri, Sep 05, 2025 at 09:15:31AM +0000, Hangbin Liu wrote:
> hsr_for_each_port is called in many places without holding the RCU read
> lock, this may trigger warnings on debug kernels. Most of the callers
> are actually hold rtnl lock. So add a new helper hsr_for_each_port_rtnl
> to allow callers in suitable contexts to iterate ports safely without
> explicit RCU locking.
>
> This patch only fixed the callers that is hold rtnl lock. Other caller
> issues will be fixed in later patches.
>
> Fixes: c5a759117210 ("net/hsr: Use list_head (and rcu) instead of array for slave devices.")
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
> ---
> net/hsr/hsr_device.c | 18 +++++++++---------
> net/hsr/hsr_main.c | 2 +-
> net/hsr/hsr_main.h | 3 +++
> 3 files changed, 13 insertions(+), 10 deletions(-)
Thanks,
I've done a once over all the callers of these functions
(which was quite a task) and I believe they all hold
either RTNL or rcu_read_lock.
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists