]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: fix locking in sysfs primary/active selection
authorJay Vosburgh <fubar@us.ibm.com>
Fri, 18 Jan 2008 00:24:57 +0000 (16:24 -0800)
committerJeff Garzik <jeff@garzik.org>
Fri, 18 Jan 2008 19:38:38 +0000 (14:38 -0500)
commitef1e444ea8de4205b8251d822372c2bc5344acfe
tree9f6cd6b7e15614bc47d85806e4b5472ac65ab2ca
parent094b388d74852a19123bc75c545d506c41b43186
bonding: fix locking in sysfs primary/active selection

Fix the functions that store the primary and active slave
options via sysfs to hold the correct locks in the correct order.

The bond_change_active_slave and bond_select_active_slave
functions both require rtnl, bond->lock for read and curr_slave_lock for
write_bh, and no other locks.  This is so that the lower level
mode-specific functions (notably for balance-alb mode) can release locks
down to just rtnl in order to call, e.g., dev_set_mac_address with the
locks it expects (rtnl only).

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/bonding/bond_sysfs.c