[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080514181528.1ff1791a@extreme>
Date: Wed, 14 May 2008 18:15:28 -0700
From: Stephen Hemminger <shemminger@...tta.com>
To: David Miller <davem@...emloft.net>, fubar@...ibm.com
Cc: netdev@...r.kernel.org, bonding-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] bonding: handle case of device named bonding_master
If device already exists named bonding_masters, then fail. This is a wierd
corner case only a QA group could love.
Signed-off-by: Stephen Hemminger <shemminger@...tta.com>
---
Note: bonding is not yet network namespace aware, it will need lots of
work to get this to happen.
--- a/drivers/net/bonding/bond_sysfs.c 2008-05-14 17:49:29.000000000 -0700
+++ b/drivers/net/bonding/bond_sysfs.c 2008-05-14 18:02:36.000000000 -0700
@@ -1437,8 +1437,16 @@ int bond_create_sysfs(void)
* configure multiple bonding devices.
*/
if (ret == -EEXIST) {
- netdev_class = NULL;
- return 0;
+ /* Is someone being kinky and naming a device bonding_master? */
+ if (__dev_get_by_name(&init_net,
+ class_attr_bonding_masters.attr.name))
+ printk(KERN_ERR
+ "network device named %s already exists in sysfs",
+ class_attr_bonding_masters.attr.name);
+ else {
+ netdev_class = NULL;
+ return 0;
+ }
}
return ret;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists