summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJonathan Toppins <jtoppins@redhat.com>2022-11-23 00:24:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 13:41:05 +0300
commita7fc25159d6f125df6994819c5c8220e3b2e6d50 (patch)
treed5b2db8ea5ed44e9aa9a56503d5d35f0984185c3 /drivers
parent0879f594a7c4ff53d5d510fb380399e3b631ffb0 (diff)
downloadlinux-a7fc25159d6f125df6994819c5c8220e3b2e6d50.tar.xz
bonding: fix link recovery in mode 2 when updelay is nonzero
[ Upstream commit f8a65ab2f3ff7410921ebbf0dc55453102c33c56 ] Before this change when a bond in mode 2 lost link, all of its slaves lost link, the bonding device would never recover even after the expiration of updelay. This change removes the updelay when the bond currently has no usable links. Conforming to bonding.txt section 13.1 paragraph 4. Fixes: 41f891004063 ("bonding: ignore updelay param when there is no active slave") Signed-off-by: Jonathan Toppins <jtoppins@redhat.com> Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/bonding/bond_main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index dc351832b108..0b7994cb9380 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2107,7 +2107,16 @@ static int bond_miimon_inspect(struct bonding *bond)
struct slave *slave;
bool ignore_updelay;
- ignore_updelay = !rcu_dereference(bond->curr_active_slave);
+ if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) {
+ ignore_updelay = !rcu_dereference(bond->curr_active_slave);
+ } else {
+ struct bond_up_slave *usable_slaves;
+
+ usable_slaves = rcu_dereference(bond->usable_slaves);
+
+ if (usable_slaves && usable_slaves->count == 0)
+ ignore_updelay = true;
+ }
bond_for_each_slave_rcu(bond, slave, iter) {
bond_propose_link_state(slave, BOND_LINK_NOCHANGE);