1 From foo@baz Sat Apr 20 16:43:09 CEST 2019
2 From: Sabrina Dubroca <sd@queasysnail.net>
3 Date: Fri, 12 Apr 2019 15:04:10 +0200
4 Subject: bonding: fix event handling for stacked bonds
6 From: Sabrina Dubroca <sd@queasysnail.net>
8 [ Upstream commit 92480b3977fd3884649d404cbbaf839b70035699 ]
10 When a bond is enslaved to another bond, bond_netdev_event() only
11 handles the event as if the bond is a master, and skips treating the
14 This leads to a refcount leak on the slave, since we don't remove the
15 adjacency to its master and the master holds a reference on the slave.
18 ip link add bondL type bond
19 ip link add bondU type bond
20 ip link set bondL master bondU
23 No "Fixes:" tag, this code is older than git history.
25 Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
26 Signed-off-by: David S. Miller <davem@davemloft.net>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 drivers/net/bonding/bond_main.c | 6 +++++-
30 1 file changed, 5 insertions(+), 1 deletion(-)
32 --- a/drivers/net/bonding/bond_main.c
33 +++ b/drivers/net/bonding/bond_main.c
34 @@ -3214,8 +3214,12 @@ static int bond_netdev_event(struct noti
37 if (event_dev->flags & IFF_MASTER) {
40 netdev_dbg(event_dev, "IFF_MASTER\n");
41 - return bond_master_netdev_event(event, event_dev);
42 + ret = bond_master_netdev_event(event, event_dev);
43 + if (ret != NOTIFY_DONE)
47 if (event_dev->flags & IFF_SLAVE) {