From: Hangbin Liu <hangbin.liu@linux.dev>
To: Nikolay Aleksandrov <razor@blackwall.org>
Cc: Jay Vosburgh <jv@jvosburgh.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Jussi Maki <joamaki@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Hangbin Liu <liuhangbin@kylinos.cn>
Subject: Re: [PATCH net v2] bonding: fix slave_cnt leak on XDP error paths
Date: Thu, 3 Sep 2026 17:27:20 +0800 [thread overview]
Message-ID: <apk9eDWX069eRKCF@fedora> (raw)
In-Reply-To: <30c405c0-d17b-4107-a4f4-d2595c661892@blackwall.org>
On Thu, Sep 03, 2026 at 11:18:32AM +0300, Nikolay Aleksandrov wrote:
> > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> > index 947d92a669b6..f3290aee50d1 100644
> > --- a/drivers/net/bonding/bond_main.c
> > +++ b/drivers/net/bonding/bond_main.c
> > @@ -2284,7 +2284,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
> > }
> > }
> > - WRITE_ONCE(bond->slave_cnt, bond->slave_cnt + 1);
> > netdev_compute_master_upper_features(bond->dev, true);
> > bond_set_carrier(bond);
> > @@ -2339,6 +2338,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
> > bond_xdp_set_features(bond_dev);
> > + WRITE_ONCE(bond->slave_cnt, bond->slave_cnt + 1);
> > +
> > slave_info(bond_dev, slave_dev, "Enslaving as %s interface with %s link\n",
> > bond_is_active_slave(new_slave) ? "an active" : "a backup",
> > new_slave->link != BOND_LINK_DOWN ? "an up" : "a down");
> >
> > ---
> > base-commit: 70f3995830d3f1e79faa14eb0605914f778feca9
> > change-id: 20260807-bond_slave_cnt-88e78c5f0ab9
> >
> > Best regards,
>
> Thanks, looks good to me. One minor nit if there's another version - mention
> also the WRITE_ONCE() in the commit message or better yet do it in a separate
> commit that properly annotates slave_cnt everywhere.
The WRITE_ONCE() change is made by Eric's recent fix
bc93419130bb ("net: bonding: annotate lockless writes with WRITE_ONCE()").
Do you mean add a comment for all the slave_cnt usage?
Thanks
Hangbin
next prev parent reply other threads:[~2026-09-03 9:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 8:10 [PATCH net v2] bonding: fix slave_cnt leak on XDP error paths Hangbin Liu
2026-09-03 8:18 ` Nikolay Aleksandrov
2026-09-03 9:27 ` Hangbin Liu [this message]
2026-09-03 9:31 ` Nikolay Aleksandrov
2026-09-03 10:38 ` Matthieu Baerts
2026-09-03 11:53 ` Nikolay Aleksandrov
2026-09-04 1:30 ` Hangbin Liu
2026-09-04 1:40 ` Hangbin Liu
2026-09-04 1:58 ` Hangbin Liu
2026-09-03 16:22 ` Jakub Kicinski
2026-09-04 2:01 ` Hangbin Liu
2026-09-04 14:11 ` [syzbot ci] " syzbot ci
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=apk9eDWX069eRKCF@fedora \
--to=hangbin.liu@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joamaki@gmail.com \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuhangbin@kylinos.cn \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox