Backport: bonding: fix state transition issue in link monitoring
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Medium
|
Po-Hsu Lin | ||
Bionic |
Fix Released
|
Medium
|
Po-Hsu Lin | ||
Disco |
Fix Released
|
Medium
|
Po-Hsu Lin | ||
Eoan |
Fix Released
|
Medium
|
Po-Hsu Lin | ||
Focal |
Fix Released
|
Medium
|
Po-Hsu Lin |
Bug Description
== Justification ==
From the well explained commit message:
Since de77ecd4ef02 ("bonding: improve link-status update in
mii-monitoring"), the bonding driver has utilized two separate variables
to indicate the next link state a particular slave should transition to.
Each is used to communicate to a different portion of the link state
change commit logic; one to the bond_miimon_commit function itself, and
another to the state transition logic.
Unfortunately, the two variables can become unsynchronized,
resulting in incorrect link state transitions within bonding. This can
cause slaves to become stuck in an incorrect link state until a
subsequent carrier state transition.
The issue occurs when a special case in bond_slave_
sets slave->link directly to BOND_LINK_FAIL. On the next pass through
bond_miimon_inspect after the slave goes carrier up, the BOND_LINK_FAIL
case will set the proposed next state (link_new_state) to BOND_LINK_UP,
but the new_link to BOND_LINK_DOWN. The setting of the final link state
from new_link comes after that from link_new_state, and so the slave
will end up incorrectly in _DOWN state.
Resolve this by combining the two variables into one.
== Fixes ==
* 1899bb32 (bonding: fix state transition issue in link monitoring)
This patch can be cherry-picked into E/F
For older releases like B/D, it will needs to be backported as they are
missing the slave_err() printk marco added in 5237ff79 (bonding: add
slave_foo printk macros) as well as the commit to replace netdev_err()
with slave_err() in e2a7420d (bonding/main: convert to using slave
printk macros)
For Xenial, the commit that causes this issue, de77ecd4, does not exist.
== Test ==
Test kernels can be found here:
https:/
The X-hwe and Disco kernel were tested by the bug reporter, Aleksei,
the patched kernel works as expected.
== Regression Potential ==
Low.
This patch just unify the variable used in link state change commit
logic to prevent the occurrence of an incorrect state. And the changes
are limited to the bonding driver itself.
(Although the include/
the changes to that file is only affecting this bond_main.c driver)
== Original Bug Report ==
There's an issue with bonding driver in the current ubuntu kernels.
Sometimes one link stuck in a weird state.
It was fixed with patch https:/
Commit 1899bb325149e48
We see this bug with linux 4.15 (ubuntu xenial, hwe kernel), but it should be reproducible with other current kernel versions.
tags: | added: bionic disco |
tags: | added: eoan focal |
tags: | added: sts |
Changed in linux (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Disco): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Eoan): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Focal): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Disco): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Eoan): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Bionic): | |
status: | In Progress → Fix Committed |
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:
apport-collect 1852077
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.