diff options
author | Xiangning Yu <yuxiangning@gmail.com> | 2018-06-07 08:39:59 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-06-26 03:06:28 +0300 |
commit | 584b975af0d29c461920acb4d512f70b0bbe3661 (patch) | |
tree | c929b0769147a3322391cb532fb498a98f8e3c9c /drivers/net/bonding | |
parent | 33445c07cd45541410fb4cabd08b10827764c07f (diff) | |
download | linux-584b975af0d29c461920acb4d512f70b0bbe3661.tar.xz |
bonding: re-evaluate force_primary when the primary slave name changes
[ Upstream commit eb55bbf865d9979098c6a7a17cbdb41237ece951 ]
There is a timing issue under active-standy mode, when bond_enslave() is
called, bond->params.primary might not be initialized yet.
Any time the primary slave string changes, bond->force_primary should be
set to true to make sure the primary becomes the active slave.
Signed-off-by: Xiangning Yu <yuxiangning@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_options.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c index 5931aa2fe997..61084ba69a99 100644 --- a/drivers/net/bonding/bond_options.c +++ b/drivers/net/bonding/bond_options.c @@ -1142,6 +1142,7 @@ static int bond_option_primary_set(struct bonding *bond, slave->dev->name); rcu_assign_pointer(bond->primary_slave, slave); strcpy(bond->params.primary, slave->dev->name); + bond->force_primary = true; bond_select_active_slave(bond); goto out; } |