Patchwork [2/5] bonding: vlans don't get deleted on enslave failure

login
register
mail settings
Submitter Nikolay Aleksandrov
Date April 18, 2013, 2:34 p.m.
Message ID <1366295697-31037-3-git-send-email-nikolay@redhat.com>
Download mbox | patch
Permalink /patch/237664/
State Superseded
Delegated to: David Miller
Headers show

Comments

Nikolay Aleksandrov - April 18, 2013, 2:34 p.m.
The main problem is with vid refcount which only gets bumped up.
Delete the vlans after err_detach as that's the first error path
after the vlans are added.

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
 drivers/net/bonding/bond_main.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index dc0153b..bf5a9df 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1904,6 +1904,7 @@  err_detach:
 		bond_mc_list_flush(bond_dev, slave_dev);
 		netif_addr_unlock_bh(bond_dev);
 	}
+	bond_del_vlans_from_slave(bond, slave_dev);
 	write_lock_bh(&bond->lock);
 	bond_detach_slave(bond, new_slave);
 	write_unlock_bh(&bond->lock);