Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

aoe: remove dev_base_lock use from aoecmd_cfg_pkts()

dev_base_lock is the legacy way to lock the device list, and is planned
to disappear. (writers hold RTNL, readers hold RCU lock)

Convert aoecmd_cfg_pkts() to RCU locking.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "Ed L. Cashin" <ecashin@coraid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
840a185d 1d5439b9

+3 -3
+3 -3
drivers/block/aoe/aoecmd.c
··· 297 297 struct sk_buff *skb; 298 298 struct net_device *ifp; 299 299 300 - read_lock(&dev_base_lock); 301 - for_each_netdev(&init_net, ifp) { 300 + rcu_read_lock(); 301 + for_each_netdev_rcu(&init_net, ifp) { 302 302 dev_hold(ifp); 303 303 if (!is_aoe_netif(ifp)) 304 304 goto cont; ··· 325 325 cont: 326 326 dev_put(ifp); 327 327 } 328 - read_unlock(&dev_base_lock); 328 + rcu_read_unlock(); 329 329 } 330 330 331 331 static void