Ethernet Bridge development
 help / color / mirror / Atom feed
From: Sasikanth V <sasikanth.v19@gmail.com>
To: shemminger@linux-foundation.org
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org
Subject: [Bridge] [PATCH] Bridge: Removed unwanted check and improper usage of bridge locks
Date: Tue, 29 Mar 2011 23:54:32 +0530	[thread overview]
Message-ID: <1301423072-28093-1-git-send-email-sasikanth.v19@gmail.com> (raw)


Signed-off-by: Sasikanth V <sasikanth.v19@gmail.com>
---
 net/bridge/br_device.c    |    5 ++++-
 net/bridge/br_stp_if.c    |    2 --
 net/bridge/br_stp_timer.c |    3 ---
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 21e5901..6cc612b 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -80,10 +80,13 @@ static int br_dev_open(struct net_device *dev)
 
 	netif_carrier_off(dev);
 
-	br_features_recompute(br);
 	netif_start_queue(dev);
+
+	spin_lock_bh(&br->lock);
+	br_features_recompute(br);
 	br_stp_enable_bridge(br);
 	br_multicast_open(br);
+	spin_unlock_bh(&br->lock);
 
 	return 0;
 }
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 5593f5a..472d8b2 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -44,7 +44,6 @@ void br_stp_enable_bridge(struct net_bridge *br)
 {
 	struct net_bridge_port *p;
 
-	spin_lock_bh(&br->lock);
 	mod_timer(&br->hello_timer, jiffies + br->hello_time);
 	mod_timer(&br->gc_timer, jiffies + HZ/10);
 
@@ -55,7 +54,6 @@ void br_stp_enable_bridge(struct net_bridge *br)
 			br_stp_enable_port(p);
 
 	}
-	spin_unlock_bh(&br->lock);
 }
 
 /* NO locks held */
diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c
index 3e96514..18244b2 100644
--- a/net/bridge/br_stp_timer.c
+++ b/net/bridge/br_stp_timer.c
@@ -65,8 +65,6 @@ static void br_message_age_timer_expired(unsigned long arg)
 	 * check is redundant. I'm leaving it in for now, though.
 	 */
 	spin_lock(&br->lock);
-	if (p->state == BR_STATE_DISABLED)
-		goto unlock;
 	was_root = br_is_root_bridge(br);
 
 	br_become_designated_port(p);
@@ -74,7 +72,6 @@ static void br_message_age_timer_expired(unsigned long arg)
 	br_port_state_selection(br);
 	if (br_is_root_bridge(br) && !was_root)
 		br_become_root_bridge(br);
- unlock:
 	spin_unlock(&br->lock);
 }
 
-- 
1.7.3.4


             reply	other threads:[~2011-03-29 18:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29 18:24 Sasikanth V [this message]
2011-03-31 15:36 ` [Bridge] [PATCH] Bridge: Removed unwanted check and improper usage of bridge locks Stephen Hemminger

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=1301423072-28093-1-git-send-email-sasikanth.v19@gmail.com \
    --to=sasikanth.v19@gmail.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.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