mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-13 07:31:07 +00:00
hsr: no longer rely on RTNL in hsr_fill_info()
hsr_fill_info() used hsr_port_get_hsr(), which walks hsr->ports with hsr_for_each_port_rtnl(), forcing "ip link show" dumps to hold RTNL. hsr->ports is an RCU protected list: ports are added with list_add_tail_rcu(), removed with list_del_rcu() and freed with kfree_rcu(), and the data path already iterates over it with hsr_for_each_port(). Add a local RCU variant of hsr_port_get_hsr() and use it from hsr_fill_info() under rcu_read_lock(). The remaining fields (sup_multicast_addr, prot_version) are set once at device creation. hsr->sequence_nr is now read with READ_ONCE(), since the transmit paths increment it under hsr->seqnr_lock only. Also add missing const qualifiers. Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260916132822.1791040-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
41c57cf050
commit
9f8b888ced
1 changed files with 26 additions and 9 deletions
Loading…
Add table
Add a link
Reference in a new issue