提交 3b410a31 编写于 作者: N Neil Horman 提交者: David S. Miller

bonding: Fix netconsole to not deadlock on rmmod

Netconsole calls netpoll_cleanup on receipt of a NETDEVICE_UNREGISTER event.
The notifier subsystem calls these event handlers with rtnl_lock held, which
netpoll_cleanup also takes, resulting in deadlock.  Fix this by calling the
__netpoll_cleanup interior function instead, and fixing up the additional
pointers.
Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 990c3d6f
...@@ -678,7 +678,14 @@ static int netconsole_netdev_event(struct notifier_block *this, ...@@ -678,7 +678,14 @@ static int netconsole_netdev_event(struct notifier_block *this,
strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ); strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ);
break; break;
case NETDEV_UNREGISTER: case NETDEV_UNREGISTER:
netpoll_cleanup(&nt->np); /*
* rtnl_lock already held
*/
if (nt->np.dev) {
__netpoll_cleanup(&nt->np);
dev_put(nt->np.dev);
nt->np.dev = NULL;
}
/* Fall through */ /* Fall through */
case NETDEV_GOING_DOWN: case NETDEV_GOING_DOWN:
case NETDEV_BONDING_DESLAVE: case NETDEV_BONDING_DESLAVE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册