On Thu, Dec 03, 2026 at 06:29:51AM +0000, netd…@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential > issue(s) to consider. > > Critical: 0 · High: 0 · Medium: 1 · Low: 1 > > If you believe none of the issues are legitimate, please reply to each > issue of Medium severity or higher and explain why the AI is wrong. > If any of them are legitimate and you plan to respin, please let patchwork > know by including "pw-bot: cr" as a separate line at the end of your reply > (one such reply per series is enough). > > - [Medium] Looking only at this commit: after the revert, > bond_set_slave_arr() publishes bond->usable_slaves for… > - [Low] bonding: missing Fixes trailer on revert of commit 45fc134bcfad > > -- > > Revert "bonding: do not set usable_slaves for broadcast mode" > > This reverts 45fc134bcfad so that bond_set_slave_arr() publishes > bond->usable_slaves in broadcast mode again. The goal is to let > bond_miimon_inspect() skip updelay when no slaves are usable. The > commit message says the follow-up patch, "bonding: update slave array > on link change for broadcast mode", handles the stale array side. >
> > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c > > index 042d7c75548fa..d6675e87d06b6 100644 > > --- a/drivers/net/bonding/bond_main.c > > +++ b/drivers/net/bonding/bond_main.c > > @@ -5140,18 +5140,13 @@ static void bond_set_slave_arr(struct bonding *bond, > > { > > struct bond_up_slave *usable, *all; > > > > - all = rtnl_dereference(bond->all_slaves); > > - rcu_assign_pointer(bond->all_slaves, all_slaves); > > - kfree_rcu(all, rcu); > > - > > - if (BOND_MODE(bond) == BOND_MODE_BROADCAST) { > > - kfree_rcu(usable_slaves, rcu); > > - return; > > - } > > - > > usable = rtnl_dereference(bond->usable_slaves); > > rcu_assign_pointer(bond->usable_slaves, usable_slaves);
> > [Severity: Low] > The changelog identifies the reverted commit and carries Cc: stable, > but there is no Fixes: trailer. This revert fixes a regression that > 45fc134bcfad introduced. bond_set_slave_arr() stopped publishing > bond->usable_slaves in broadcast mode, so bond_miimon_inspect() could > no longer set ignore_updelay. Shouldn't this carry a Fixes: tag > pointing at 45fc134bcfad ("bonding: do not set usable_slaves for > broadcast mode")? > > This matters for more than tidiness. Stable backport tooling uses > Fixes: to decide which trees need a patch. Patch 2/3 in this series > carries Fixes: e0caeb24f538 ("net: bonding: update the slave array > for broadcast mode") and depends on this revert.
Stable tree will backport the whole series.
> > Suppose only the follow-up is picked for a tree that already has > 45fc134bcfad. The broadcast early return in bond_set_slave_arr() is > still there, so usable_slaves stays NULL. The new rebuild calls would > then not change the ignore_updelay decision at all. > > Could the Fixes: tag be added in the next revision?
OK, if there is a new version, I can add the Fixes tag.
> > [Severity: Medium] > On its own, can this commit leave a stale usable_slaves array in > broadcast mode? > > At this point in the series, broadcast mode rebuilds the array only in > bond_enslave() and __bond_release_one(). bond_miimon_link_change() only > rebuilds it for BOND_MODE_XOR: > > bond_miimon_link_change() { > ... > case BOND_MODE_XOR: > bond_update_slave_arr(bond, NULL); > break; > ... > } > > bond_open(), bond_slave_netdev_event() and the ARP load-balance monitor > only check bond_mode_can_use_xmit_hash(), so they skip broadcast too. > > With miimon and updelay set, bond_enslave() puts a slave that already > has carrier into BOND_LINK_BACK: > > if (bond->params.updelay) { > bond_set_slave_link_state(new_slave, > BOND_LINK_BACK, > ... > > That means the array published at enslave time has count == 0. > bond_miimon_inspect() then sees this on every later pass: > > if (usable_slaves && usable_slaves->count == 0) > ignore_updelay = true; > > Wouldn't updelay be ignored permanently here? That is the behaviour > 45fc134bcfad fixed. > > It can also go the other way. An array built while slaves were up stays > non-empty after every link drops. Wouldn't the first slave to recover > still wait out the full updelay, which is the symptom this revert is > meant to fix? > > The next patch, "bonding: update slave array on link change for > broadcast mode", resolves this. It adds BOND_MODE_BROADCAST handling > to bond_miimon_link_change(), bond_loadbalance_arp_mon(), > bond_slave_netdev_event() and bond_open().
As you said, the later patch fixed the issues. Thanks Hangbin