aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@gmail.com>2014-07-17 06:04:08 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-17 19:33:27 -0400
commit23fa5c2caae08f919d906b1064b9fdc352b3024e (patch)
tree58133f2417646760c55d04efa15c1b43b4f0d6fb /drivers/net/bonding
parent14056e7930761b730e2b34ae716e151ba890f3bf (diff)
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>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5e5b3b30c51c..14f789551616 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4448,7 +4448,6 @@ static void __net_exit bond_net_exit(struct net *net)
4448 LIST_HEAD(list); 4448 LIST_HEAD(list);
4449 4449
4450 bond_destroy_sysfs(bn); 4450 bond_destroy_sysfs(bn);
4451 bond_destroy_proc_dir(bn);
4452 4451
4453 /* Kill off any bonds created after unregistering bond rtnl ops */ 4452 /* Kill off any bonds created after unregistering bond rtnl ops */
4454 rtnl_lock(); 4453 rtnl_lock();
@@ -4456,6 +4455,8 @@ static void __net_exit bond_net_exit(struct net *net)
4456 unregister_netdevice_queue(bond->dev, &list); 4455 unregister_netdevice_queue(bond->dev, &list);
4457 unregister_netdevice_many(&list); 4456 unregister_netdevice_many(&list);
4458 rtnl_unlock(); 4457 rtnl_unlock();
4458
4459 bond_destroy_proc_dir(bn);
4459} 4460}
4460 4461
4461static struct pernet_operations bond_net_ops = { 4462static struct pernet_operations bond_net_ops = {