All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Michael Wang <wangyun@linux.vnet.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	netfilter@vger.kernel.org, coreteam@netfilter.org,
	netfilter-devel@vger.kernel.org,
	David Miller <davem@davemloft.net>,
	kaber@trash.net, pablo@netfilter.org
Subject: Re: [PATCH 3/3] netfilter: replace list_for_each_continue_rcu with new interface
Date: Mon, 20 Aug 2012 17:02:55 -0700	[thread overview]
Message-ID: <20120821000254.GP2435@linux.vnet.ibm.com> (raw)
In-Reply-To: <502DC9A3.2070703@linux.vnet.ibm.com>

On Fri, Aug 17, 2012 at 12:33:39PM +0800, Michael Wang wrote:
> From: Michael Wang <wangyun@linux.vnet.ibm.com>
> 
> This patch replaces list_for_each_continue_rcu() with
> list_for_each_entry_continue_rcu() to allow removing
> list_for_each_continue_rcu().
> 
> Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>

Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

> ---
>  net/netfilter/core.c |   11 +++++++----
>  1 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/net/netfilter/core.c b/net/netfilter/core.c
> index e19f365..50225bd 100644
> --- a/net/netfilter/core.c
> +++ b/net/netfilter/core.c
> @@ -131,14 +131,14 @@ unsigned int nf_iterate(struct list_head *head,
>  			int hook_thresh)
>  {
>  	unsigned int verdict;
> +	struct nf_hook_ops *elem = list_entry_rcu(*i,
> +						struct nf_hook_ops, list);
> 
>  	/*
>  	 * The caller must not block between calls to this
>  	 * function because of risk of continuing from deleted element.
>  	 */
> -	list_for_each_continue_rcu(*i, head) {
> -		struct nf_hook_ops *elem = (struct nf_hook_ops *)*i;
> -
> +	list_for_each_entry_continue_rcu(elem, head, list) {
>  		if (hook_thresh > elem->priority)
>  			continue;
> 
> @@ -155,11 +155,14 @@ repeat:
>  				continue;
>  			}
>  #endif
> -			if (verdict != NF_REPEAT)
> +			if (verdict != NF_REPEAT) {
> +				*i = &elem->list;
>  				return verdict;
> +			}
>  			goto repeat;
>  		}
>  	}
> +	*i = &elem->list;
>  	return NF_ACCEPT;
>  }
> 
> -- 
> 1.7.4.1
> 
> 


  reply	other threads:[~2012-08-21  0:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <502CB939.3050008@linux.vnet.ibm.com>
2012-08-17  4:33 ` [PATCH 3/3] netfilter: replace list_for_each_continue_rcu with new interface Michael Wang
2012-08-21  0:02   ` Paul E. McKenney [this message]
2012-08-22 22:32   ` Pablo Neira Ayuso

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=20120821000254.GP2435@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=wangyun@linux.vnet.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.