mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: paulmck@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org, shemminger@vyatta.com,
	linville@tuxdriver.com, sri@us.ibm.com,
	akpm@linux-foundation.org
Subject: Re: [PATCH] list_for_each_rcu must die: networking
Date: Wed, 23 Apr 2008 18:35:23 -0700 (PDT)	[thread overview]
Message-ID: <20080423.183523.149346715.davem@davemloft.net> (raw)
In-Reply-To: <20080424013208.GA26526@linux.vnet.ibm.com>

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!

  reply	other threads:[~2008-04-24  1:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24  1:32 Paul E. McKenney
2008-04-24  1:35 ` David Miller [this message]
2008-04-24  3:38 Paul E. McKenney
2008-05-15  0:16 ` Paul E. McKenney
2008-05-15  5:26   ` Kamalesh Babulal
2008-05-15  6:20     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080423.183523.149346715.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=shemminger@vyatta.com \
    --cc=sri@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome