Patchwork [2/2] bonding: IFF_BONDING is not stripped on enslave failure

login
register
mail settings
Submitter Nikolay Aleksandrov
Date April 9, 2013, 8:17 p.m.
Message ID <1365538644-1502-2-git-send-email-nikolay@redhat.com>
Download mbox | patch
Permalink /patch/235227/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Nikolay Aleksandrov - April 9, 2013, 8:17 p.m.
While enslaving a new device and after IFF_BONDING flag is set, in case
of failure it is not stripped from the device's priv_flags while
cleaning up, which could lead to other problems.
Cleaning at err_close because the flag is set after dev_open().

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 9995ddc..0d9ee48 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1906,6 +1906,7 @@  err_detach:
 	write_unlock_bh(&bond->lock);
 
 err_close:
+	slave_dev->priv_flags &= ~IFF_BONDING;
 	dev_close(slave_dev);
 
 err_unset_master: