From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-2?Q?Micha=B3_Miros=B3aw?= Subject: Re: [PATCH net-next] bridge: multicast router list manipulation Date: Wed, 28 Apr 2010 01:11:52 +0200 Message-ID: References: <20100228054012.GA7583@gondor.apana.org.au> <20100427101311.2f445227@nehalam> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Herbert Xu , "David S. Miller" , netdev@vger.kernel.org To: Stephen Hemminger Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:62395 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752486Ab0D0XLy convert rfc822-to-8bit (ORCPT ); Tue, 27 Apr 2010 19:11:54 -0400 Received: by wye20 with SMTP id 20so335710wye.19 for ; Tue, 27 Apr 2010 16:11:52 -0700 (PDT) In-Reply-To: <20100427101311.2f445227@nehalam> Sender: netdev-owner@vger.kernel.org List-ID: 2010/4/27 Stephen Hemminger : > I prefer that the hlist be only accessed through the hlist macro > objects. Explicit twiddling of links (especially with RCU) exposes > the code to future bugs. [...] > - =A0 =A0 =A0 port->rlist.pprev =3D h; > - =A0 =A0 =A0 port->rlist.next =3D p; > - =A0 =A0 =A0 rcu_assign_pointer(*h, &port->rlist); > - =A0 =A0 =A0 if (p) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 p->pprev =3D &port->rlist.next; > + =A0 =A0 =A0 hlist_for_each_entry(p, n, &br->router_list, rlist) { Shouldn't this be hlist_for_each_entry_rcu? > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((unsigned long) port >=3D (unsigned= long) p) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hlist_add_before_rcu(n,= &port->rlist); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 last =3D n; > + =A0 =A0 =A0 } > + > + =A0 =A0 =A0 if (last) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 hlist_add_after_rcu(last, &port->rlist)= ; > + =A0 =A0 =A0 else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 hlist_add_head_rcu(&port->rlist, &br->r= outer_list); > =A0} > [...] Best Regards, Micha=B3 Miros=B3aw