]> git.baikalelectronics.ru Git - kernel.git/commit
net/bonding: Destroy bonding master when last slave is gone
authorMoni Shoua <monis@voltaire.com>
Wed, 10 Oct 2007 02:43:43 +0000 (19:43 -0700)
committerJeff Garzik <jeff@garzik.org>
Mon, 15 Oct 2007 18:20:46 +0000 (14:20 -0400)
commit97830be519ff110f7ce31b79cee3abac94782778
treeeff59bda3c6fcec2556b7d80838979e6fe705a43
parentcc06be5281992a27fb74d884edf1818dfcd66ae7
net/bonding: Destroy bonding master when last slave is gone

When bonding enslaves non Ethernet devices it takes pointers to functions
in the module that owns the slaves. In this case it becomes unsafe
to keep the bonding master registered after last slave was unenslaved
because we don't know if the pointers are still valid.  Destroying the bond when slave_cnt is zero
ensures that these functions be used anymore.

Signed-off-by: Moni Shoua <monis at voltaire.com>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_sysfs.c
drivers/net/bonding/bonding.h