Stephen Hemminger
2007-Apr-18 17:22 UTC
[Bridge] [PATCH] 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).
diff -Nru a/net/bridge/br_if.c b/net/bridge/br_if.c
--- a/net/bridge/br_if.c Mon Jan 12 13:45:44 2004
+++ b/net/bridge/br_if.c Mon Jan 12 13:45:44 2004
@@ -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;
}
David S. Miller
2007-Apr-18 17:22 UTC
[Bridge] Re: [PATCH] bridge use read_lock when scanning device list
On Mon, 12 Jan 2004 13:46:45 -0800 Stephen Hemminger <shemminger@osdl.org> wrote:> 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.