netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: nikolay@redhat.com
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com,
	andy@greyhouse.net, j.vosburgh@gmail.com, vfalico@gmail.com
Subject: Re: [PATCH net v2] bonding: fix div by zero while enslaving and transmitting
Date: Sat, 13 Sep 2014 17:17:46 -0400 (EDT)	[thread overview]
Message-ID: <20140913.171746.547311064738045536.davem@davemloft.net> (raw)
In-Reply-To: <1410536298-8022-1-git-send-email-nikolay@redhat.com>

From: Nikolay Aleksandrov <nikolay@redhat.com>
Date: Fri, 12 Sep 2014 17:38:18 +0200

> The problem is that the slave is first linked and slave_cnt is
> incremented afterwards leading to a div by zero in the modes that use it
> as a modulus. What happens is that in bond_start_xmit()
> bond_has_slaves() is used to evaluate further transmission and it becomes
> true after the slave is linked in, but when slave_cnt is used in the xmit
> path it is still 0, so fetch it once and transmit based on that. Since
> it is used only in round-robin and XOR modes, the fix is only for them.
> Thanks to Eric Dumazet for pointing out the fault in my first try to fix
> this.
  ...
> Fixes: 278b208375 ("bonding: initial RCU conversion")
> Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
> ---
> v2: Based on Eric's feedback change the fix to fetch the value once in a
>     local variable in the affected modes and to act based on that.

Applied and queued up for -stable, thanks.

  reply	other threads:[~2014-09-13 21:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 12:22 [PATCH net] bonding: fix div by zero while enslaving and transmitting Nikolay Aleksandrov
2014-09-12 13:09 ` Eric Dumazet
2014-09-12 13:27   ` Nikolay Aleksandrov
2014-09-12 13:33     ` Nikolay Aleksandrov
2014-09-12 14:45       ` Eric Dumazet
2014-09-12 14:55         ` Nikolay Aleksandrov
2014-09-12 15:38           ` [PATCH net v2] " Nikolay Aleksandrov
2014-09-13 21:17             ` David Miller [this message]
2014-09-17  6:15             ` Ding Tianhong
2014-09-17 11:08               ` Nikolay Aleksandrov
2014-09-18 10:59                 ` Ding Tianhong

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=20140913.171746.547311064738045536.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andy@greyhouse.net \
    --cc=eric.dumazet@gmail.com \
    --cc=j.vosburgh@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@redhat.com \
    --cc=vfalico@gmail.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).