]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: fix locking in enslave failure path
authornikolay@redhat.com <nikolay@redhat.com>
Mon, 22 Apr 2013 08:12:22 +0000 (08:12 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Apr 2013 08:03:21 +0000 (04:03 -0400)
commit2f507f9cf90bede1b7700588fb9ca38be533bbb8
tree3a15cd4d3dcbb1d057d7e60fe1efb1346c0ef942
parent2d47f4da7d1d505ef1aa1b79fd42f10bf1b5b7f8
bonding: fix locking in enslave failure path

In commit 4b63c5dc3a217ee05d8a7eedfbbe9e92982a3136 ("bonding:
primary_slave & curr_active_slave are not cleaned on enslave failure")
I didn't account for the use of curr_active_slave without curr_slave_lock
and since there are such users, we should hold bond->lock for writing while
setting it to NULL (in the NULL case we don't need the curr_slave_lock).
Keeping the bond lock as to avoid the extra release/acquire cycle.

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c