]> 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)
commitd28784ad3fd06e8c3e4d5abdb108246f57b0ceb4
tree3a15cd4d3dcbb1d057d7e60fe1efb1346c0ef942
parent77760150a4ea8ebc6ed3db0ec98da9df30356e68
bonding: fix locking in enslave failure path

In commit 44dfd7d640709e1de01fc3e3045407893b264ba9 ("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