linux/drivers/net/bonding
Pavel Emelyanov ae68c39819 bonding: Deadlock between bonding_store_bonds and bond_destroy_sysfs.
The sysfs layer has an internal protection, that ensures, that
all the process sitting inside ->sore/->show callback exits
before the appropriate entry is unregistered (the calltraces
are rather big, but I can provide them if required).

On the other hand, bonding takes rtnl_lock in
a) the bonding_store_bonds, i.e. in ->store callback,
b) module exit before calling the sysfs unregister routines.

Thus, the classical AB-BA deadlock may occur. To reproduce run
# while :; do modprobe bonding; rmmod bonding; done
and
# while :; do echo '+bond%d' > /sys/class/net/bonding_masters ; done
in parallel.

The fix is to move the bond_destroy_sysfs out of the rtnl_lock,
but _before_ bond_free_all to make sure no bonding devices exist
after module unload.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-05-06 12:01:30 -04:00
..
bond_3ad.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-03-27 18:48:56 -07:00
bond_3ad.h Convert bonding timers to workqueues 2007-10-23 20:32:00 -04:00
bond_alb.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-03-27 18:48:56 -07:00
bond_alb.h Convert bonding timers to workqueues 2007-10-23 20:32:00 -04:00
bond_main.c bonding: Deadlock between bonding_store_bonds and bond_destroy_sysfs. 2008-05-06 12:01:30 -04:00
bond_sysfs.c bonding: fix error unwind in bonding_store_bonds 2008-05-06 12:01:29 -04:00
bonding.h bonding: update version 2008-03-25 23:15:51 -04:00
Makefile [PATCH] bonding: add sysfs functionality to bonding (large) 2005-11-13 14:48:21 -05:00