Skip to contentSkip to conversation

bridge use read_lock when scanning device list

PATCH Applied Stephen Hemminger 2 participants 2 messages Jan 12, 2004 – Jan 14, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bridge use read_lock when scanning device list

On 2.6.1, bridge is using rtnl_shlock which is equivalent to rtnl_lock when all it really needs to do is read_lock(&dev_base_lock).

net/bridge/br_if.c +2 -2
diff -Nru a/net/bridge/br_if.c b/net/bridge/br_if.c
@@ -252,12 +252,12 @@
 	struct net_device *dev;
 	int i = 0;
 
-	rtnl_shlock();
+	read_lock(&dev_base_lock);
 	for (dev = dev_base; dev && i < num; dev = dev->next) {
 		if (dev->priv_flags & IFF_EBRIDGE) 
 			indices[i++] = dev->ifindex;
 	}
-	rtnl_shunlock();
+	read_unlock(&dev_base_lock);
 
 	return i;
 }
#1 lore raw
Quoted 2 lines · On Mon, 12 Jan 2004 13:46:45 -0800 Stephen Hemminger <[email protected]>…

On 2.6.1, bridge is using rtnl_shlock which is equivalent to rtnl_lock when all it really needs to do is read_lock(&dev_base_lock).

Applied, thanks Stephen.