From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Marek Lindner Date: Thu, 10 Feb 2011 14:57:56 +0100 References: <201102031802.52134.lindner_marek@yahoo.de> <1296832896-30081-3-git-send-email-linus.luessing@ascom.ch> <20110210124544.GC13038@Sellars> In-Reply-To: <20110210124544.GC13038@Sellars> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201102101457.57316.lindner_marek@yahoo.de> Subject: Re: [B.A.T.M.A.N.] [PATCH 2/7] batman-adv: Correct rcu refcounting for softif_neigh Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: The list for a Better Approach To Mobile Ad-hoc Networking On Thursday 10 February 2011 13:45:44 Linus L=C3=BCssing wrote: > > - goto found; > > + goto out; > >=20 > > } >=20 > Hmm, we could do a rcu_read_unlock() here, already, I think. Would > it be better to do so, keeping the rcu grace period as small as > possible? Can you be more specific where "here" is ? Instead of the "goto out" ? > The rest of the new atomic handling seems fine. Just two more > things I noticed while reading the softif_neigh specific code: > bat_priv->softif_neigh needs to be changed to a rcu-protected > pointer. Agreed. > There's a race condition in softif_neigh_seq_print_text(), between > the rcu_read_unlock() and rcu_read_lock() the number of > softif_neigh's can have increased and there's no check for > accidentally writing outside of the allocated buffer. Also correct - are you going to send a patch ? Regards, Marek