]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: destroy proc directory only after all bonds are gone
authorVeaceslav Falico <vfalico@gmail.com>
Thu, 17 Jul 2014 10:04:08 +0000 (12:04 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jul 2014 23:33:27 +0000 (16:33 -0700)
commite1195f91e33c22d01d7151c7efd1822ca2f5a933
tree58133f2417646760c55d04efa15c1b43b4f0d6fb
parentd7511c41fd99404d9f86b2e83f3a695d382c69c4
bonding: destroy proc directory only after all bonds are gone

Currently we might arrive to bond_net_exit() with some bonds left (that
were created while the module is unloading). We take care of that by
destroying sysfs (the last possibility to add new bonds) and then
destroying all the remaining bonds.

However, we destroy the /proc/net/bonding directory before destroying those
last bonds, and get a warning that we're trying to destroy a non-empty
proc directory (containing /proc/net/bonding/bondX).

Fix this by moving bond_destroy_proc_dir() after all the bonds are
destroyed, so that we're sure that no bonds exist.

CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c