From: David Miller <davem@davemloft.net>
To: jay.vosburgh@canonical.com
Cc: netdev@vger.kernel.org, zakharov.a.g@yandex.ru,
zhangsha.zhang@huawei.com, maheshb@google.com, vfalico@gmail.com,
andy@greyhouse.net
Subject: Re: [PATCH v2 net] bonding: fix state transition issue in link monitoring
Date: Tue, 05 Nov 2019 17:40:51 -0800 (PST) [thread overview]
Message-ID: <20191105.174051.2132646390435868066.davem@davemloft.net> (raw)
In-Reply-To: <2068.1572670602@famine>
From: Jay Vosburgh <jay.vosburgh@canonical.com>
Date: Fri, 01 Nov 2019 21:56:42 -0700
> 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_netdev_event
> 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.
>
> Reported-by: Aleksei Zakharov <zakharov.a.g@yandex.ru>
> Reported-by: Sha Zhang <zhangsha.zhang@huawei.com>
> Cc: Mahesh Bandewar <maheshb@google.com>
> Fixes: de77ecd4ef02 ("bonding: improve link-status update in mii-monitoring")
> Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Applied and queued up for -stable, thanks.
prev parent reply other threads:[~2019-11-06 1:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-02 4:56 [PATCH v2 net] bonding: fix state transition issue in link monitoring Jay Vosburgh
2019-11-06 1:40 ` David Miller [this message]
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=20191105.174051.2132646390435868066.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=andy@greyhouse.net \
--cc=jay.vosburgh@canonical.com \
--cc=maheshb@google.com \
--cc=netdev@vger.kernel.org \
--cc=vfalico@gmail.com \
--cc=zakharov.a.g@yandex.ru \
--cc=zhangsha.zhang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).