All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] bonding: destroy proc directory only after all bonds are gone
@ 2014-07-17 10:04 Veaceslav Falico
  2014-07-17 23:37 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Veaceslav Falico @ 2014-07-17 10:04 UTC (permalink / raw)
  To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek

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>
---
 drivers/net/bonding/bond_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 1ff676ca..b4cee84 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4450,7 +4450,6 @@ static void __net_exit bond_net_exit(struct net *net)
 	LIST_HEAD(list);
 
 	bond_destroy_sysfs(bn);
-	bond_destroy_proc_dir(bn);
 
 	/* Kill off any bonds created after unregistering bond rtnl ops */
 	rtnl_lock();
@@ -4458,6 +4457,8 @@ static void __net_exit bond_net_exit(struct net *net)
 		unregister_netdevice_queue(bond->dev, &list);
 	unregister_netdevice_many(&list);
 	rtnl_unlock();
+
+	bond_destroy_proc_dir(bn);
 }
 
 static struct pernet_operations bond_net_ops = {
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] bonding: destroy proc directory only after all bonds are gone
  2014-07-17 10:04 [PATCH net-next] bonding: destroy proc directory only after all bonds are gone Veaceslav Falico
@ 2014-07-17 23:37 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-07-17 23:37 UTC (permalink / raw)
  To: vfalico; +Cc: netdev, j.vosburgh, andy

From: Veaceslav Falico <vfalico@gmail.com>
Date: Thu, 17 Jul 2014 12:04:08 +0200

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-17 23:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-17 10:04 [PATCH net-next] bonding: destroy proc directory only after all bonds are gone Veaceslav Falico
2014-07-17 23:37 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.