From: David Miller <davem@davemloft.net>
To: joe.lawrence@stratus.com
Cc: netdev@vger.kernel.org, jiri@resnulli.us
Subject: Re: [PATCH] team: avoid race condition in scheduling delayed work
Date: Sat, 04 Oct 2014 20:51:28 -0400 (EDT) [thread overview]
Message-ID: <20141004.205128.1396970963248010476.davem@davemloft.net> (raw)
In-Reply-To: <1412344714-29938-1-git-send-email-joe.lawrence@stratus.com>
From: Joe Lawrence <joe.lawrence@stratus.com>
Date: Fri, 3 Oct 2014 09:58:34 -0400
> When team_notify_peers and team_mcast_rejoin are called, they both reset
> their respective .count_pending atomic variable. Then when the actual
> worker function is executed, the variable is atomically decremented.
> This pattern introduces a potential race condition where the
> .count_pending rolls over and the worker function keeps rescheduling
> until .count_pending decrements to zero again:
...
> Instead of assigning a new value to .count_pending, use atomic_add to
> tack-on the additional desired worker function invocations.
>
> Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
> Acked-by: Jiri Pirko <jiri@resnulli.us>
> Fixes: fc423ff00df3a19554414ee ("team: add peer notification")
> Fixes: 492b200efdd20b8fcfdac87 ("team: add support for sending multicast rejoins")
Applied and queued up for -stable, thanks.
prev parent reply other threads:[~2014-10-05 0:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-03 13:58 [PATCH] team: avoid race condition in scheduling delayed work Joe Lawrence
2014-10-05 0:51 ` 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=20141004.205128.1396970963248010476.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jiri@resnulli.us \
--cc=joe.lawrence@stratus.com \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).