netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Linus Lüssing" <linus.luessing@web.de>
Cc: Cong Wang <amwang@redhat.com>,
	netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, Adam Baker <linux@baker-net.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCHv2] bridge: disable snooping if there is no querier
Date: Thu, 25 Jul 2013 09:01:40 -0700	[thread overview]
Message-ID: <20130725090140.658f33f7@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <1374760580-12920-1-git-send-email-linus.luessing@web.de>

On Thu, 25 Jul 2013 15:56:20 +0200
Linus Lüssing <linus.luessing@web.de> wrote:

>  
> +static void br_multicast_update_querier_timer(struct net_bridge *br,
> +					      unsigned long max_delay)
> +{
> +	if (!timer_pending(&br->multicast_querier_timer))
> +		atomic64_set(&br->multicast_querier_delay_time,
> +			     jiffies + max_delay);
> +
> +	mod_timer(&br->multicast_querier_timer,
> +		  jiffies + br->multicast_querier_interval);
> +}
> +

Isn't this test racing with timer expiration.

static void br_multicast_update_querier_timer(struct net_bridge *br,
					      unsigned long max_delay)
{
	if (!timer_pending(&br->multicast_querier_timer))
		atomic64_set(&br->multicast_querier_delay_time,
			     jiffies + max_delay);
What if timer completes here?

	mod_timer(&br->multicast_querier_timer,
		  jiffies + br->multicast_querier_interval);
}


And another race if timer goes off?

static void br_multicast_update_querier_timer(struct net_bridge *br,
					      unsigned long max_delay)
{
	if (!timer_pending(&br->multicast_querier_timer))
		atomic64_set(&br->multicast_querier_delay_time,
			     jiffies + max_delay);
Timer fires here...?

	mod_timer(&br->multicast_querier_timer,
		  jiffies + br->multicast_querier_interval);
}

  reply	other threads:[~2013-07-25 16:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 12:57 [PATCH] bridge: disable snooping if there is no querier Linus Lüssing
2013-07-25 13:56 ` [PATCHv2] " Linus Lüssing
2013-07-25 16:01   ` Stephen Hemminger [this message]
2013-07-25 19:31     ` Linus Lüssing
2013-07-26 22:19   ` Adam Baker
2013-07-27 15:54     ` Linus Lüssing
2013-07-30 23:10   ` David Miller
2013-07-31 23:06     ` [PATCHv3] " Linus Lüssing
2013-08-01  0:40       ` David Miller
2013-08-05  8:41         ` Paul Bolle
2013-08-05 22:40           ` Linus Lüssing

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=20130725090140.658f33f7@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=amwang@redhat.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linus.luessing@web.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@baker-net.org.uk \
    --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).