netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bonding: ban stacked bonding support
@ 2015-02-20 22:20 Alexey Dobriyan
  2015-02-20 23:14 ` Jay Vosburgh
  0 siblings, 1 reply; 9+ messages in thread
From: Alexey Dobriyan @ 2015-02-20 22:20 UTC (permalink / raw)
  To: davem; +Cc: j.vosburgh, vfalico, andy, netdev

Does Linux support it at all?

In short: if you add bonding master as a slave, and then release it,
it will no longer be a IFF_BONDING creating problems like described at
https://bugzilla.kernel.org/show_bug.cgi?id=89541

	echo +bond1 >/sys/class/net/bonding_masters
	echo 1 >/sys/class/net/bond1/bonding/mode
	echo +bond2 >/sys/class/net/bonding_masters
	echo +bond2 >/sys/class/net/bond1/bonding/slaves
	echo -bond2 >/sys/class/net/bond1/bonding/slaves
	echo -bond2 >/sys/class/net/bonding_masters

	cat /proc/net/bonding/bond2		# should not exist
		[oops]

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 drivers/net/bonding/bond_main.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1248,6 +1248,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 			    slave_dev->name);
 	}
 
+	if (slave_dev->flags & IFF_MASTER) {
+		netdev_dbg(bond_dev, "stacked bonding not supported\n");
+		return -EBUSY;
+	}
+
 	/* already enslaved */
 	if (slave_dev->flags & IFF_SLAVE) {
 		netdev_dbg(bond_dev, "Error: Device was already enslaved\n");

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-03-20 22:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-20 22:20 [PATCH] bonding: ban stacked bonding support Alexey Dobriyan
2015-02-20 23:14 ` Jay Vosburgh
2015-02-21  2:55   ` Andy Gospodarek
2015-02-21 16:59   ` Jiri Pirko
2015-03-20 17:43   ` Alexey Dobriyan
2015-03-20 17:46     ` [PATCH v2] " Alexey Dobriyan
2015-03-20 20:38       ` David Miller
2015-03-20 21:02         ` Jay Vosburgh
2015-03-20 22:30           ` Jay Vosburgh

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).