netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: vfalico@redhat.com
Cc: nikolay@redhat.com, netdev@vger.kernel.org, andy@greyhouse.net,
	fubar@us.ibm.com
Subject: Re: [PATCH net] bonding: fix a div error caused by the slave release path
Date: Wed, 26 Feb 2014 17:23:44 -0500 (EST)	[thread overview]
Message-ID: <20140226.172344.2063576636598224310.davem@davemloft.net> (raw)
In-Reply-To: <20140226132854.GA24011@redhat.com>

From: Veaceslav Falico <vfalico@redhat.com>
Date: Wed, 26 Feb 2014 14:28:54 +0100

> On Wed, Feb 26, 2014 at 02:20:30PM +0100, Nikolay Aleksandrov wrote:
>>There's a bug in the slave release function which leads the transmit
>>functions which use the bond->slave_cnt to a div by 0 because we might
>>just have released our last slave and made slave_cnt == 0 but at the
>>same
>>time we may have a transmitter after the check for an empty list which
>>will
>>fetch it and use it in the slave id calculation.
>>Fix it by moving the slave_cnt after synchronize_rcu so if this was
>>our
>>last slave any new transmitters will see an empty slave list which is
>>checked after rcu lock but before calling the mode transmit functions
>>which rely on bond->slave_cnt.
>>
>>Fixes: 278b208375 ("bonding: initial RCU conversion")
>>
>>CC: Veaceslav Falico <vfalico@redhat.com>
>>CC: Andy Gospodarek <andy@greyhouse.net>
>>CC: Jay Vosburgh <fubar@us.ibm.com>
>>CC: David S. Miller <davem@davemloft.net>
>>
>>Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
> 
> Acked-by: Veaceslav Falico <vfalico@redhat.com>

Applied, thanks.

      reply	other threads:[~2014-02-26 22:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 13:20 [PATCH net] bonding: fix a div error caused by the slave release path Nikolay Aleksandrov
2014-02-26 13:28 ` Veaceslav Falico
2014-02-26 22:23   ` 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=20140226.172344.2063576636598224310.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andy@greyhouse.net \
    --cc=fubar@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@redhat.com \
    --cc=vfalico@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 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).