netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][BONDING] Allow setting max_bonds to zero
@ 2008-02-29 18:52 Phil Oester
  0 siblings, 0 replies; only message in thread
From: Phil Oester @ 2008-02-29 18:52 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 2 bytes --]




[-- Attachment #2: patch-zerobonds --]
[-- Type: text/plain, Size: 1456 bytes --]

commit fc78750341ab174a16f865625b24377670e92e50
Author: Phil Oester <kernel@linuxace.com>
Date:   Fri Feb 29 13:43:34 2008 -0500

    If the bonding driver is compiled into the kernel, it will create a
    "bond0" device by default.  The patch below allows max_bonds to be
    set to 0 to prevent any devices from being created.
    
    Phil
    
    Signed-off-by: Phil Oester <kernel@linuxace.com>

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 64597d8..2bef4b4 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4624,11 +4624,11 @@ static int bond_check_params(struct bond_params *params)
 		}
 	}
 
-	if (max_bonds < 1 || max_bonds > INT_MAX) {
+	if (max_bonds > INT_MAX) {
 		printk(KERN_WARNING DRV_NAME
-		       ": Warning: max_bonds (%d) not in range %d-%d, so it "
+		       ": Warning: max_bonds (%d) not in range 0-%d, so it "
 		       "was reset to BOND_DEFAULT_MAX_BONDS (%d)\n",
-		       max_bonds, 1, INT_MAX, BOND_DEFAULT_MAX_BONDS);
+		       max_bonds, INT_MAX, BOND_DEFAULT_MAX_BONDS);
 		max_bonds = BOND_DEFAULT_MAX_BONDS;
 	}
 
@@ -4982,9 +4982,11 @@ static int __init bonding_init(void)
 			goto err;
 	}
 
-	res = bond_create_sysfs();
-	if (res)
-		goto err;
+	if (max_bonds > 0) {
+		res = bond_create_sysfs();
+		if (res)
+			goto err;
+	}
 
 	register_netdevice_notifier(&bond_netdev_notifier);
 	register_inetaddr_notifier(&bond_inetaddr_notifier);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-29 18:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-29 18:52 [PATCH][BONDING] Allow setting max_bonds to zero Phil Oester

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).