Skip to content

Commit f8a65ab

Browse files
Jonathan Toppinskuba-moo
authored andcommitted
bonding: fix link recovery in mode 2 when updelay is nonzero
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: 41f8910 ("bonding: ignore updelay param when there is no active slave") Signed-off-by: Jonathan Toppins <[email protected]> Acked-by: Jay Vosburgh <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d43eff0 commit f8a65ab

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2529,7 +2529,16 @@ static int bond_miimon_inspect(struct bonding *bond)
25292529
struct slave *slave;
25302530
bool ignore_updelay;
25312531

2532-
ignore_updelay = !rcu_dereference(bond->curr_active_slave);
2532+
if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) {
2533+
ignore_updelay = !rcu_dereference(bond->curr_active_slave);
2534+
} else {
2535+
struct bond_up_slave *usable_slaves;
2536+
2537+
usable_slaves = rcu_dereference(bond->usable_slaves);
2538+
2539+
if (usable_slaves && usable_slaves->count == 0)
2540+
ignore_updelay = true;
2541+
}
25332542

25342543
bond_for_each_slave_rcu(bond, slave, iter) {
25352544
bond_propose_link_state(slave, BOND_LINK_NOCHANGE);

0 commit comments

Comments
 (0)