netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Ryan Harper <ryanh@us.ibm.com>, "David S. Miller" <davem@davemloft.net>
Cc: netdev@oss.sgi.com, Chris Wright <chrisw@osdl.org>,
	Greg KH <greg@kroah.com>
Subject: [PATCH] br: fix race on bridge del if
Date: Tue, 11 Oct 2005 13:33:28 -0700	[thread overview]
Message-ID: <20051011133328.26db65d7@localhost.localdomain> (raw)
In-Reply-To: <20050818214036.GH10593@us.ibm.com>

This fixes the RCU race on bridge delete interface.  Basically,
the network device has to be detached from the bridge in the first
step (pre-RCU), rather than later. At that point, no more bridge traffic
will come in, and the other code will not think that network device
is part of a bridge.

This should also fix the XEN test problems. If there is another
2.6.13-stable, add it as well.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

Index: nexgate-test/net/bridge/br_if.c
===================================================================
--- nexgate-test.orig/net/bridge/br_if.c
+++ nexgate-test/net/bridge/br_if.c
@@ -79,7 +79,6 @@ static void destroy_nbp(struct net_bridg
 {
 	struct net_device *dev = p->dev;
 
-	dev->br_port = NULL;
 	p->br = NULL;
 	p->dev = NULL;
 	dev_put(dev);
@@ -100,6 +99,7 @@ static void del_nbp(struct net_bridge_po
 	struct net_bridge *br = p->br;
 	struct net_device *dev = p->dev;
 
+	dev->br_port = NULL;
 	dev_set_promiscuity(dev, -1);
 
 	spin_lock_bh(&br->lock);

  parent reply	other threads:[~2005-10-11 20:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-18 21:40 Possible race with br_del_if() Ryan Harper
2005-08-18 22:12 ` Stephen Hemminger
2005-08-18 22:23   ` Ryan Harper
2005-08-18 22:35     ` Stephen Hemminger
2005-08-18 22:56       ` Ryan Harper
2005-08-19 19:10       ` Ryan Harper
2005-08-19 19:40         ` Stephen Hemminger
2005-10-11 20:33 ` Stephen Hemminger [this message]
2005-10-12 22:10   ` [PATCH] br: fix race on bridge del if David S. Miller

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=20051011133328.26db65d7@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=chrisw@osdl.org \
    --cc=davem@davemloft.net \
    --cc=greg@kroah.com \
    --cc=netdev@oss.sgi.com \
    --cc=ryanh@us.ibm.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).