]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: remove sysfs before removing devices
authorVeaceslav Falico <vfalico@redhat.com>
Wed, 3 Apr 2013 05:46:33 +0000 (05:46 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Apr 2013 04:46:13 +0000 (00:46 -0400)
commit382dc6732540e1d3e8183b1d6c2ba5b007f8239a
tree13f1ea930500381271013346af4a62e364b6ade2
parent248274f2c67a1c3e9764a35c1805e6f40815ef3a
bonding: remove sysfs before removing devices

We have a race condition if we try to rmmod bonding and simultaneously add
a bond master through sysfs. In bonding_exit() we first remove the devices
(through rtnl_link_unregister() ) and only after that we remove the sysfs.
If we manage to add a device through sysfs after that the devices were
removed - we'll end up with that device/sysfs structure and with the module
unloaded.

Fix this by first removing the sysfs and only after that calling
rtnl_link_unregister().

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