]> git.baikalelectronics.ru Git - kernel.git/commit
netpoll: Fix __netpoll_rcu_free so that it can hold the rtnl lock
authorNeil Horman <nhorman@tuxdriver.com>
Mon, 11 Feb 2013 10:25:30 +0000 (10:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Feb 2013 00:19:33 +0000 (19:19 -0500)
commitbff9b8a7f5f7c7f99cf4c81f321ddc67ed3fdcbc
tree77353244a904fbb41e8658cceedb4b5120c5552a
parent00a1e442e7f5a02a8dc3b5caabc04e6a207c1856
netpoll: Fix __netpoll_rcu_free so that it can hold the rtnl lock

__netpoll_rcu_free is used to free netpoll structures when the rtnl_lock is
already held.  The mechanism is used to asynchronously call __netpoll_cleanup
outside of the holding of the rtnl_lock, so as to avoid deadlock.
Unfortunately, __netpoll_cleanup modifies pointers (dev->np), which means the
rtnl_lock must be held while calling it.  Further, it cannot be held, because
rcu callbacks may be issued in softirq contexts, which cannot sleep.

Fix this by converting the rcu callback to a work queue that is guaranteed to
get scheduled in process context, so that we can hold the rtnl properly while
calling __netpoll_cleanup

Tested successfully by myself.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Cong Wang <amwang@redhat.com>
CC: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c
include/linux/netpoll.h
net/8021q/vlan_dev.c
net/bridge/br_device.c
net/core/netpoll.c