]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: unset primary slave via sysfs
authorMilos Vyletel <milos.vyletel@sde.cz>
Tue, 29 Jan 2013 09:59:00 +0000 (09:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Jan 2013 20:43:35 +0000 (15:43 -0500)
commitdd5d60dc9a846ec2be8d43195696a3dd0d244886
treea64adf6da4aba4f0f9dc60b9a21bfdbbb6872fe6
parent14e122aa1a554b49dc7c1aa936c2f2f07d6e719d
bonding: unset primary slave via sysfs

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: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Milos Vyletel <milos.vyletel@sde.cz>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_sysfs.c