[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20080423.183523.149346715.davem@davemloft.net>
Date: Wed, 23 Apr 2008 18:35:23 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: paulmck@...ux.vnet.ibm.com
Cc: linux-kernel@...r.kernel.org, shemminger@...tta.com,
linville@...driver.com, sri@...ibm.com, akpm@...ux-foundation.org
Subject: Re: [PATCH] list_for_each_rcu must die: networking
From: "Paul E. McKenney" <paulmck@...ux.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@...emloft.net>
Feel free to submit these yourself, together with your other
list RCU changes.
Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists