DORMANTno replies

[PATCH 2.6.13-rc1 7/17] bonding: make sysfs consistent with ifenslave behavior

From: Radheka Godse <hidden>
Date: 2005-07-01 20:47:04

For consistency with ifenslave, instead of exiting with an error, updated 
bonding sysfs to close and attempt to enslave an up adapter.

Signed-off-by: Radheka Godse <redacted>
Signed-off-by: Mitch Williams <redacted>

diff -urN -X dontdiff linux-2.6.12post/drivers/net/bonding/bond_main.c linux-2.6.12post-sysfs/drivers/net/bonding/bond_main.c
--- linux-2.6.12post/drivers/net/bonding/bond_main.c	2005-06-28 18:18:03.000000000 -0700
+++ linux-2.6.12post-sysfs/drivers/net/bonding/bond_main.c	2005-06-30 13:53:55.000000000 -0700
@@ -1665,10 +1665,19 @@
  		 */
  		if ((slave_dev->flags & IFF_UP)) {
  			printk(KERN_ERR DRV_NAME
-			       ": Error: %s is up\n",
-			       slave_dev->name);
+			       ": %s: Warning: %s is up. Closing it "
+			       "before adding to the bond.\n",
+			       bond_dev->name, slave_dev->name);
  			res = -EPERM;
-			goto err_undo_flags;
+			res = dev_close(slave_dev);
+			if (res)
+			{
+				printk(KERN_ERR DRV_NAME
+				    ": %s: Error: Failed to close %s.\n",
+				    bond_dev->name, slave_dev->name);
+				res = -EPERM;
+				goto err_undo_flags;
+			}
  		}

  		if (slave_dev->set_mac_address == NULL) {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help