From: Veaceslav Falico <vfalico@redhat.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: netdev@vger.kernel.org, nikolay@redhat.com,
bhutchings@solarflare.com, Jay Vosburgh <fubar@us.ibm.com>,
Andy Gospodarek <andy@greyhouse.net>
Subject: Re: [PATCH net-next 2/9] bonding: remove __get_first_port()
Date: Fri, 27 Sep 2013 16:58:25 +0200 [thread overview]
Message-ID: <20130927145825.GA14139@redhat.com> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B7365@saturn3.aculab.com>
On Fri, Sep 27, 2013 at 03:50:12PM +0100, David Laight wrote:
>> @@ -2104,8 +2091,11 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
>>
>> // check if agg_select_timer timer after initialize is timed out
>> if (BOND_AD_INFO(bond).agg_select_timer && !(--BOND_AD_INFO(bond).agg_select_timer)) {
>> + slave = bond_first_slave(bond);
>> + port = slave ? &(SLAVE_AD_INFO(slave).port) : NULL;
>> +
>> // select the active aggregator for the bond
>> - if ((port = __get_first_port(bond))) {
>> + if (port) {
>> if (!port->slave) {
>> pr_warning("%s: Warning: bond's first port is uninitialized\n",
>> bond->dev->name);
>> --
>
>Looks like that could be:
> slave = bond_first_slave(bond);
> if (slave) {
> port = SLAVE_AD_INFO(slave).port;
>and I assume 'slave == port->slave' so there is no need for the latter check?
I've also fallen to this trap at first - slave->port can (virtually) be
NULL, and this way we'll panic on "if (!port->slave)".
>
> David
>
>
>
next prev parent reply other threads:[~2013-09-27 15:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-27 14:11 [PATCH net-next 0/9] bonding: remove bond_next_slave() Veaceslav Falico
2013-09-27 14:11 ` [PATCH net-next 1/9] bonding: remove __get_next_port() Veaceslav Falico
2013-09-27 14:11 ` [PATCH net-next 2/9] bonding: remove __get_first_port() Veaceslav Falico
2013-09-27 14:50 ` David Laight
2013-09-27 14:58 ` Veaceslav Falico [this message]
2013-09-27 15:05 ` Veaceslav Falico
2013-09-27 14:11 ` [PATCH net-next 3/9] bonding: make ad_port_selection_logic() use bond_for_each_slave() Veaceslav Falico
2013-09-27 14:12 ` [PATCH net-next 4/9] bonding: make __get_active_agg() " Veaceslav Falico
2013-09-27 14:12 ` [PATCH net-next 5/9] bonding: make ad_agg_selection_logic() " Veaceslav Falico
2013-09-27 14:12 ` [PATCH net-next 6/9] bonding: make bond_3ad_unbind_slave() " Veaceslav Falico
2013-09-27 14:12 ` [PATCH net-next 7/9] bonding: remove unused __get_next_agg() Veaceslav Falico
2013-09-27 14:12 ` [PATCH net-next 8/9] bonding: don't use bond_next_slave() in bond_info_seq_next() Veaceslav Falico
2013-09-27 14:12 ` [PATCH net-next 9/9] bonding: remove bond_next_slave() Veaceslav Falico
2013-09-28 22:29 ` [PATCH net-next 0/9] " David Miller
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=20130927145825.GA14139@redhat.com \
--to=vfalico@redhat.com \
--cc=David.Laight@ACULAB.COM \
--cc=andy@greyhouse.net \
--cc=bhutchings@solarflare.com \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.