From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754853AbbCYOgR (ORCPT ); Wed, 25 Mar 2015 10:36:17 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:52541 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752646AbbCYOgO (ORCPT ); Wed, 25 Mar 2015 10:36:14 -0400 Date: Wed, 25 Mar 2015 07:36:07 -0700 From: "Paul E. McKenney" To: Patrick Marlier Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] netfilter: fix list_entry_rcu usage. Message-ID: <20150325143607.GA27413@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <55113D10.4050309@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55113D10.4050309@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15032514-0025-0000-0000-000009787207 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2015 at 11:31:44AM +0100, Patrick Marlier wrote: > Signed-off-by: Patrick Marlier > --- > net/netfilter/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/netfilter/core.c b/net/netfilter/core.c > index fea9ef5..05bd311 100644 > --- a/net/netfilter/core.c > +++ b/net/netfilter/core.c > @@ -174,7 +174,7 @@ int nf_hook_slow(u_int8_t pf, unsigned int hook, > struct sk_buff *skb, > /* We may already have this, but read-locks nest anyway */ > rcu_read_lock(); > > - elem = list_entry_rcu(&nf_hooks[pf][hook], struct nf_hook_ops, list); > + elem = list_entry_rcu(nf_hooks[pf][hook].next, struct nf_hook_ops, list); And this departs from the list_entry() API. Is this really a good idea? Thanx, Paul > next_hook: > verdict = nf_iterate(&nf_hooks[pf][hook], skb, hook, indev, > outdev, &elem, okfn, hook_thresh); > -- > 2.1.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/