]> www.infradead.org Git - users/dwmw2/linux.git/commit
fib: rules: use READ_ONCE()/WRITE_ONCE() on ops->fib_rules_seq
authorEric Dumazet <edumazet@google.com>
Wed, 9 Oct 2024 18:44:01 +0000 (18:44 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 11 Oct 2024 22:35:05 +0000 (15:35 -0700)
commita716ff52bebfe806fbcf5227cee4c7bda4e6724b
tree4f920860cbc8091b53dee41009490791a29598fc
parentd677aebd663ddc287f2b2bda098474694a0ca875
fib: rules: use READ_ONCE()/WRITE_ONCE() on ops->fib_rules_seq

Using RTNL to protect ops->fib_rules_seq reads seems a big hammer.

Writes are protected by RTNL.
We can use READ_ONCE() on readers.

Constify 'struct net' argument of fib_rules_seq_read()
and lookup_rules_ops().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20241009184405.3752829-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/fib_rules.h
net/core/fib_rules.c