summaryrefslogtreecommitdiff
path: root/net/ipv6
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-02-13 06:32:39 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-17 12:02:23 +0200
commit1c2b0f0823f8e031569ce14da9b336fe77d7b3c3 (patch)
tree2a9667591633785002c70a5e925c6cf732210034 /net/ipv6
parent8745a8d74ba17dafe72b6ab461fa6c007d879747 (diff)
downloadlinux-rpi-1c2b0f0823f8e031569ce14da9b336fe77d7b3c3.tar.gz
linux-rpi-1c2b0f0823f8e031569ce14da9b336fe77d7b3c3.tar.bz2
linux-rpi-1c2b0f0823f8e031569ce14da9b336fe77d7b3c3.zip
net-sysfs: convert dev->operstate reads to lockless ones
[ Upstream commit 004d138364fd10dd5ff8ceb54cfdc2d792a7b338 ] operstate_show() can omit dev_base_lock acquisition only to read dev->operstate. Annotate accesses to dev->operstate. Writers still acquire dev_base_lock for mutual exclusion. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Stable-dep-of: 4893b8b3ef8d ("hsr: Simplify code for announcing HSR nodes timer setup") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index d1806eee1687..01f4502916a1 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -6011,7 +6011,7 @@ static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev,
(dev->ifindex != dev_get_iflink(dev) &&
nla_put_u32(skb, IFLA_LINK, dev_get_iflink(dev))) ||
nla_put_u8(skb, IFLA_OPERSTATE,
- netif_running(dev) ? dev->operstate : IF_OPER_DOWN))
+ netif_running(dev) ? READ_ONCE(dev->operstate) : IF_OPER_DOWN))
goto nla_put_failure;
protoinfo = nla_nest_start_noflag(skb, IFLA_PROTINFO);
if (!protoinfo)