提交 9fdce099 编写于 作者: E Eric W. Biederman 提交者: David S. Miller

veth: Fix unregister_netdevice_queue for veth

I tested the recent unregister many changes and got a weird,
nasty and seemingly unrelasted kernel oops. Changing
unregister_netdevice_queue to use list_move_tail fixes
the problem for me.

ip link add type veth
rmmod veth

ls /sys/class/net/
showed one of the veth devices still present.

A subsequent ip link oopsed the box.
Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 72c9528b
...@@ -5258,6 +5258,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, ...@@ -5258,6 +5258,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
netdev_init_queues(dev); netdev_init_queues(dev);
INIT_LIST_HEAD(&dev->napi_list); INIT_LIST_HEAD(&dev->napi_list);
INIT_LIST_HEAD(&dev->unreg_list);
dev->priv_flags = IFF_XMIT_DST_RELEASE; dev->priv_flags = IFF_XMIT_DST_RELEASE;
setup(dev); setup(dev);
strcpy(dev->name, name); strcpy(dev->name, name);
...@@ -5339,7 +5340,7 @@ void unregister_netdevice_queue(struct net_device *dev, struct list_head *head) ...@@ -5339,7 +5340,7 @@ void unregister_netdevice_queue(struct net_device *dev, struct list_head *head)
ASSERT_RTNL(); ASSERT_RTNL();
if (head) { if (head) {
list_add_tail(&dev->unreg_list, head); list_move_tail(&dev->unreg_list, head);
} else { } else {
rollback_registered(dev); rollback_registered(dev);
/* Finish processing unregister after unlock */ /* Finish processing unregister after unlock */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册