]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
bonding: avoid NETDEV_CHANGEMTU event when unregistering slave
authorWANG Cong <xiyou.wangcong@gmail.com>
Fri, 14 Jul 2017 20:58:52 +0000 (16:58 -0400)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 9 Aug 2017 14:23:32 +0000 (16:23 +0200)
commit657725ebfd3f654b043002d19029081b6039fd0c
tree322eed28f1902e0228625bd6af3df2dd9e8a4773
parent421c4ace0f42ba60a0e421da2b06e569f0c01381
bonding: avoid NETDEV_CHANGEMTU event when unregistering slave

BugLink: http://bugs.launchpad.net/bugs/1704102
As Hongjun/Nicolas summarized in their original patch:

"
When a device changes from one netns to another, it's first unregistered,
then the netns reference is updated and the dev is registered in the new
netns. Thus, when a slave moves to another netns, it is first
unregistered. This triggers a NETDEV_UNREGISTER event which is caught by
the bonding driver. The driver calls bond_release(), which calls
dev_set_mtu() and thus triggers NETDEV_CHANGEMTU (the device is still in
the old netns).
"

This is a very special case, because the device is being unregistered
no one should still care about the NETDEV_CHANGEMTU event triggered
at this point, we can avoid broadcasting this event on this path,
and avoid touching inetdev_event()/addrconf_notify() path.

It requires to export __dev_set_mtu() to bonding driver.

Reported-by: Hongjun Li <hongjun.li@6wind.com>
Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f51048c3e07b68c90b21a77541fc4b208f9244d7)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/net/bonding/bond_main.c
include/linux/netdevice.h
net/core/dev.c