]> Pileus Git - ~andy/linux/commit
bonding: don't call alb_set_slave_mac_addr() while atomic
authorVeaceslav Falico <vfalico@redhat.com>
Mon, 17 Jun 2013 17:30:35 +0000 (19:30 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Jun 2013 23:27:24 +0000 (16:27 -0700)
commitcedb743f3e8db12cc76a706888792497953e93bb
treed3e356ab352b1cd99f18fd46219472ab20a01d69
parent72bb72b0d98847d22c6fae4e170121f3640f0f60
bonding: don't call alb_set_slave_mac_addr() while atomic

alb_set_slave_mac_addr() sets the mac address in alb mode via
dev_set_mac_address(), which might sleep. It's called from
alb_handle_addr_collision_on_attach() in atomic context (under
read_lock(bond->lock)), thus triggering a bug.

Fix this by moving the lock inside alb_handle_addr_collision_on_attach().

v1->v2:
As Nikolay Aleksandrov noticed, we can drop the bond->lock completely.
Also, use bond_slave_has_mac(), when possible.

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