• M
    bonding: unset primary slave via sysfs · eb492f74
    Milos Vyletel 提交于
    When bonding module is loaded with primary parameter and one decides to unset
    primary slave using sysfs these settings are not preserved during bond device
    restart. Primary slave is only unset once and it's not remembered in
    bond->params structure. Below is example of recreation.
    
     grep OPTS /etc/sysconfig/network-scripts/ifcfg-bond0
    BONDING_OPTS="mode=active-backup miimon=100 primary=eth01"
     grep "Primary Slave" /proc/net/bonding/bond0
    Primary Slave: eth01 (primary_reselect always)
    
     echo "" > /sys/class/net/bond0/bonding/primary
     grep "Primary Slave" /proc/net/bonding/bond0
    Primary Slave: None
    
     sed -i -e 's/primary=eth01//' /etc/sysconfig/network-scripts/ifcfg-bond0
     grep OPTS /etc/sysconfig/network-scripts/ifcfg-bond
    BONDING_OPTS="mode=active-backup miimon=100 "
     ifdown bond0 && ifup bond0
    
    without patch:
     grep "Primary Slave" /proc/net/bonding/bond0
    Primary Slave: eth01 (primary_reselect always)
    
    with patch:
     grep "Primary Slave" /proc/net/bonding/bond0
    Primary Slave: None
    Reviewed-by: NJiri Pirko <jiri@resnulli.us>
    Signed-off-by: NMilos Vyletel <milos.vyletel@sde.cz>
    Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    eb492f74
bond_sysfs.c 44.2 KB