bonding: fix 3ad slave (de)init
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bonding: correctly verify for the first slave in bond_enslavedrivers/ | +1 | 0 replies | |
| 2/2 | bonding: verify if we still have slaves in bond_3ad_unbind_slave()drivers/ | +3 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH net-next 0/2] bonding: fix 3ad slave (de)init
After 1f718f0f4f97145f4072d2d72dcf85069ca7226d ("bonding: populate neighbour's private on enslave") the (de)linking of slaves in bond_enslave/bond_release_one happens in the correct places - after we've completely initialized the slave (for bond_enslave) and before we've even began to de-init the slave (for bond_release_one, respectively).
This was done to prevent any RCU readers to see the half-initialized slave (because the RCU readers aren't blocked by bond->lock or rtnl_lock usually).
However, 802.3ad logic, in several places, relied on the fact that the slave is still linked to the bond.
Fix it by correctly handling these cases - we shouldn't rely that the slave is linked before fully initialized and, respectively, that the slave is still linked while it's being removed.
--- drivers/net/bonding/bond_3ad.c | 4 +++- drivers/net/bonding/bond_main.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-)