Commit 23fa5c2c authored by Veaceslav Falico's avatar Veaceslav Falico Committed by David S. Miller
Browse files

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 <>
CC: Andy Gospodarek <>
Signed-off-by: default avatarVeaceslav Falico <>
Signed-off-by: default avatarDavid S. Miller <>
parent 14056e79
......@@ -4448,7 +4448,6 @@ static void __net_exit bond_net_exit(struct net *net)
/* Kill off any bonds created after unregistering bond rtnl ops */
......@@ -4456,6 +4455,8 @@ static void __net_exit bond_net_exit(struct net *net)
unregister_netdevice_queue(bond->dev, &list);
static struct pernet_operations bond_net_ops = {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment