]> git.baikalelectronics.ru Git - kernel.git/commit
net: macvlan: Use built-in RCU list checking
authorChuang Wang <nashuiliang@gmail.com>
Fri, 11 Nov 2022 01:41:30 +0000 (09:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:42:15 +0000 (17:42 +0100)
commitafc374738161906b112c72479754a3273a8c3d3a
treedfe279d78f549ee1657b2712d0ab5917c92e69b8
parent7fb5f490210f074f374f86ed70070555f9ec4a7a
net: macvlan: Use built-in RCU list checking

[ Upstream commit 51be44be493b463c875e1b24306fa8c43e7119a2 ]

hlist_for_each_entry_rcu() has built-in RCU and lock checking.

Pass cond argument to hlist_for_each_entry_rcu() to silence false
lockdep warning when CONFIG_PROVE_RCU_LIST is enabled.

Execute as follow:

 ip link add link eth0 type macvlan mode source macaddr add <MAC-ADDR>

The rtnl_lock is held when macvlan_hash_lookup_source() or
macvlan_fill_info_macaddr() are called in the non-RCU read side section.
So, pass lockdep_rtnl_is_held() to silence false lockdep warning.

Fixes: 2b2bf7496d18 ("macvlan: add source mode")
Signed-off-by: Chuang Wang <nashuiliang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/macvlan.c