diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2022-11-24 07:15:13 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2022-11-24 07:15:14 +0300 |
| commit | 170d97739de484cc052d65043d57acce7ed10480 (patch) | |
| tree | 303dcc4ff90b5b78242edf0733ef25c09679a9cc /drivers | |
| parent | 64a8f8f7127da228d59a39e2c5e75f86590f90b4 (diff) | |
| parent | f8a65ab2f3ff7410921ebbf0dc55453102c33c56 (diff) | |
| download | linux-170d97739de484cc052d65043d57acce7ed10480.tar.xz | |
Merge branch 'bonding-fix-bond-recovery-in-mode-2'
Jonathan Toppins says:
====================
bonding: fix bond recovery in mode 2
When a bond is configured with a non-zero updelay and in mode 2 the bond
never recovers after all slaves lose link. The first patch adds
selftests that demonstrate the issue and the second patch fixes the
issue by ignoring the updelay when there are no usable slaves.
====================
Link: https://lore.kernel.org/r/cover.1669147951.git.jtoppins@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/bonding/bond_main.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 1cd4e71916f8..6c4348245d1f 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2529,7 +2529,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); |
