• Veaceslav Falico's avatar
    bonding: destroy proc directory only after all bonds are gone · 23fa5c2c
    Veaceslav Falico authored
    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: default avatarVeaceslav Falico <vfalico@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    23fa5c2c
bond_main.c 124 KB