lkml.org 
[lkml]   [2008]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] list_for_each_rcu must die: networking
From
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Wed, 23 Apr 2008 18:32:08 -0700

> diff -urpNa -X dontdiff linux-2.6.25/net/ipv4/af_inet.c linux-2.6.25-lfer-net/net/ipv4/af_inet.c
> --- linux-2.6.25/net/ipv4/af_inet.c 2008-04-16 19:49:44.000000000 -0700
> +++ linux-2.6.25-lfer-net/net/ipv4/af_inet.c 2008-04-23 16:56:03.000000000 -0700
> @@ -274,8 +274,7 @@ static int inet_create(struct net *net,
> lookup_protocol:
> err = -ESOCKTNOSUPPORT;
> rcu_read_lock();
> - list_for_each_rcu(p, &inetsw[sock->type]) {
> - answer = list_entry(p, struct inet_protosw, list);
> + list_for_each_entry_rcu(answer, &inetsw[sock->type], list) {
>
> /* Check the non-wild match. */
> if (protocol == answer->protocol) {

Local variable 'p' is unused after this change, please delete
it.

> diff -urpNa -X dontdiff linux-2.6.25/net/ipv6/af_inet6.c linux-2.6.25-lfer-net/net/ipv6/af_inet6.c
> --- linux-2.6.25/net/ipv6/af_inet6.c 2008-04-16 19:49:44.000000000 -0700
> +++ linux-2.6.25-lfer-net/net/ipv6/af_inet6.c 2008-04-23 16:55:51.000000000 -0700
> @@ -105,8 +105,7 @@ static int inet6_create(struct net *net,
> lookup_protocol:
> err = -ESOCKTNOSUPPORT;
> rcu_read_lock();
> - list_for_each_rcu(p, &inetsw6[sock->type]) {
> - answer = list_entry(p, struct inet_protosw, list);
> + list_for_each_entry_rcu(answer, &inetsw6[sock->type], list) {
>
> /* Check the non-wild match. */
> if (protocol == answer->protocol) {

Same here.

With those fixes:

Acked-by: David S. Miller <davem@davemloft.net>

Feel free to submit these yourself, together with your other
list RCU changes.

Thanks!


\
 
 \ /
  Last update: 2008-04-24 03:37    [W:0.058 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site