Message ID | 4B0628E0.6000404@gmail.com |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
On Fri, 20 Nov 2009 06:28:00 +0100 Eric Dumazet <eric.dumazet@gmail.com> wrote: > + read_lock(&dev_base_lock); > for_each_netdev(&init_net, dev) { > if (ipv6_chk_addr(&init_net, > &((struct sockaddr_in6 *) addr)->sin6_addr, > @@ -139,6 +140,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr) > break; > } > } > + read_unlock(&dev_base_lock); what about for_each_netdev_rcu() here instead...
Stephen Hemminger a écrit : > On Fri, 20 Nov 2009 06:28:00 +0100 > Eric Dumazet <eric.dumazet@gmail.com> wrote: > >> + read_lock(&dev_base_lock); >> for_each_netdev(&init_net, dev) { >> if (ipv6_chk_addr(&init_net, >> &((struct sockaddr_in6 *) addr)->sin6_addr, >> @@ -139,6 +140,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr) >> break; >> } >> } >> + read_unlock(&dev_base_lock); > > what about for_each_netdev_rcu() here instead... > Yes, in 2.6.33 :) For 2.6.32, we need this patch Thanks -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> Any news of this patch ? > > We need it for 2.6.32 and also to prepare 2.6.33 with upcoming patches. Sorry for not explicitly emailing about this patch. I applied it as part of Sean's series, but I just added it to my 2.6.33 queue. At this point in the release cycle it doesn't look severe enough for 2.6.32, unless I miss something. - R. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Roland Dreier a écrit : > > Any news of this patch ? > > > > We need it for 2.6.32 and also to prepare 2.6.33 with upcoming patches. > > Sorry for not explicitly emailing about this patch. I applied it as > part of Sean's series, but I just added it to my 2.6.33 queue. At this > point in the release cycle it doesn't look severe enough for 2.6.32, > unless I miss something. Its possible to get infinite loops or crashes. I am not a RDMA user, so I personally dont care :) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> Its possible to get infinite loops or crashes. > I am not a RDMA user, so I personally dont care :) I think given that it's not a regression, and I've never heard of anyone hitting it in practice, we can wait until the merge window. Thanks! -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index bd07803..5ca0b2c 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c @@ -131,6 +131,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr) #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) case AF_INET6: + read_lock(&dev_base_lock); for_each_netdev(&init_net, dev) { if (ipv6_chk_addr(&init_net, &((struct sockaddr_in6 *) addr)->sin6_addr, @@ -139,6 +140,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr) break; } } + read_unlock(&dev_base_lock); break; #endif } @@ -391,15 +393,17 @@ static int addr_resolve_local(struct sockaddr *src_in, { struct in6_addr *a; + read_lock(&dev_base_lock); for_each_netdev(&init_net, dev) if (ipv6_chk_addr(&init_net, &((struct sockaddr_in6 *) dst_in)->sin6_addr, dev, 1)) break; - if (!dev) + if (!dev) { + read_unlock(&dev_base_lock); return -EADDRNOTAVAIL; - + } a = &((struct sockaddr_in6 *) src_in)->sin6_addr; if (ipv6_addr_any(a)) { @@ -416,6 +420,7 @@ static int addr_resolve_local(struct sockaddr *src_in, if (!ret) memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN); } + read_unlock(&dev_base_lock); break; } #endif