Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932290AbXH0QYb (ORCPT ); Mon, 27 Aug 2007 12:24:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762513AbXH0QX4 (ORCPT ); Mon, 27 Aug 2007 12:23:56 -0400 Received: from e3.ny.us.ibm.com ([32.97.182.143]:34005 "EHLO e3.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760448AbXH0QXy (ORCPT ); Mon, 27 Aug 2007 12:23:54 -0400 Date: Mon, 27 Aug 2007 09:23:18 -0700 From: "Paul E. McKenney" To: Jarek Poplawski Cc: Adrian Bunk , Gabriel C , Andrew Morton , linux-kernel@vger.kernel.org, netdev Subject: Re: net/ipv4/fib_trie.c - compile error (Re: 2.6.23-rc3-mm1) Message-ID: <20070827162318.GB8290@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20070822170302.GC8786@linux.vnet.ibm.com> <20070827063635.GB1703@ff.dom.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070827063635.GB1703@ff.dom.local> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2352 Lines: 52 On Mon, Aug 27, 2007 at 08:36:35AM +0200, Jarek Poplawski wrote: > On 22-08-2007 19:03, Paul E. McKenney wrote: > > On Wed, Aug 22, 2007 at 05:41:11PM +0200, Adrian Bunk wrote: > >> On Wed, Aug 22, 2007 at 05:30:13PM +0200, Gabriel C wrote: > >>> Got it with a randconfig ( http://194.231.229.228/kernel/mm/2.6.23-rc3-mm1/r/randconfig-8 ) > >>> > >>> ... > >>> > >>> net/ipv4/fib_trie.c: In function 'trie_rebalance': > >>> net/ipv4/fib_trie.c:969: error: lvalue required as unary '&' operand > >>> net/ipv4/fib_trie.c:971: error: lvalue required as unary '&' operand > >>> net/ipv4/fib_trie.c:977: error: lvalue required as unary '&' operand > >>> net/ipv4/fib_trie.c:980: error: lvalue required as unary '&' operand > >>> ... > >> Side effect of the git-net removal, temporarily removing > >> immunize-rcu_dereference-against-crazy-compiler-writers.patch should > >> work around it. > > > > Alternatively, the following one-line patch to net/ipv4/fib_trie.c could > > be used. > > > > Signed-off-by: Paul E. McKenney > > --- > > > > fib_trie.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff -urpNa -X dontdiff linux-2.6.23-rc3-mm1/net/ipv4/fib_trie.c linux-2.6.23-rc3-mm1.compile/net/ipv4/fib_trie.c > > --- linux-2.6.23-rc3-mm1/net/ipv4/fib_trie.c 2007-08-22 09:20:33.000000000 -0700 > > +++ linux-2.6.23-rc3-mm1.compile/net/ipv4/fib_trie.c 2007-08-22 09:47:33.000000000 -0700 > > @@ -94,7 +94,7 @@ typedef unsigned int t_key; > > #define T_LEAF 1 > > #define NODE_TYPE_MASK 0x1UL > > #define NODE_PARENT(node) \ > > - ((struct tnode *)rcu_dereference(((node)->parent & ~NODE_TYPE_MASK))) > > + ((struct tnode *)(rcu_dereference((node)->parent) & ~NODE_TYPE_MASK)) > ... > > After first reading of this thread I've had an impression it's about > compiler's behavior, but now it seems to me this patch is not an > alternative, but a 'must be' and only proper way of calling > rcu_dereference (with a variable instead of an expression)? Am I > right? Yes, rcu_dereference() does indeed need to be invoked on a lvalue. Thanx, Paul - 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/