diff options
author | Weiping Pan <wpan@redhat.com> | 2012-06-10 19:00:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-12 18:23:11 -0400 |
commit | 8a93664df90db983cfede122f9b4ddb3a8284e52 (patch) | |
tree | 2b1da6946606e88a853edb62b3851a2b616d7c00 /drivers | |
parent | 5aa04d3af8916d890836ccaa9d146edee1e4c655 (diff) |
bonding:record primary when modify it via sysfs
If we modify primary via sysfs and it is not a valid slave,
we should record it for future use, and this behavior is the same with
bond_check_params().
Signed-off-by: Weiping Pan <wpan@redhat.com>
Acked-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index aef42f045320..485bedb8278c 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -1082,8 +1082,12 @@ static ssize_t bonding_store_primary(struct device *d, | |||
1082 | } | 1082 | } |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | pr_info("%s: Unable to set %.*s as primary slave.\n", | 1085 | strncpy(bond->params.primary, ifname, IFNAMSIZ); |
1086 | bond->dev->name, (int)strlen(buf) - 1, buf); | 1086 | bond->params.primary[IFNAMSIZ - 1] = 0; |
1087 | |||
1088 | pr_info("%s: Recording %s as primary, " | ||
1089 | "but it has not been enslaved to %s yet.\n", | ||
1090 | bond->dev->name, ifname, bond->dev->name); | ||
1087 | out: | 1091 | out: |
1088 | write_unlock_bh(&bond->curr_slave_lock); | 1092 | write_unlock_bh(&bond->curr_slave_lock); |
1089 | read_unlock(&bond->lock); | 1093 | read_unlock(&bond->lock); |