From patchwork Sat May 14 03:52:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Cardona X-Patchwork-Id: 784662 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4E3r4a5012776 for ; Sat, 14 May 2011 03:53:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759858Ab1ENDxA (ORCPT ); Fri, 13 May 2011 23:53:00 -0400 Received: from mail-vw0-f46.google.com ([209.85.212.46]:46977 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759848Ab1ENDxA (ORCPT ); Fri, 13 May 2011 23:53:00 -0400 Received: by vws1 with SMTP id 1so2228922vws.19 for ; Fri, 13 May 2011 20:52:59 -0700 (PDT) Received: by 10.220.178.10 with SMTP id bk10mr583691vcb.240.1305345179285; Fri, 13 May 2011 20:52:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.177.71 with HTTP; Fri, 13 May 2011 20:52:39 -0700 (PDT) In-Reply-To: <1305331247.680.7.camel@jlt3.sipsolutions.net> References: <1305203138.3461.24.camel@jlt3.sipsolutions.net> <1305270793.3487.3.camel@jlt3.sipsolutions.net> <1305331247.680.7.camel@jlt3.sipsolutions.net> From: Javier Cardona Date: Fri, 13 May 2011 20:52:39 -0700 Message-ID: Subject: Re: mesh RCU issues To: Johannes Berg Cc: linux-wireless , devel@lists.open80211s.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 14 May 2011 03:53:05 +0000 (UTC) On Fri, May 13, 2011 at 5:00 PM, Johannes Berg wrote: > On Fri, 2011-05-13 at 13:28 -0700, Javier Cardona wrote: > >> diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c >> index 83ce48e..1db8bba 100644 >> --- a/net/mac80211/mesh_pathtbl.c >> +++ b/net/mac80211/mesh_pathtbl.c > [snip] > > With this patch, I get the warnings below. Thanks. Any ideas on how to fix sparse? I'd like to see those too :) > The locking ones are definitely genuine bugs, I'm not sure I fully understand the sparse message... would this fix the two locking warnings? Javier --- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 83ce48e..fbf0c28 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -376,8 +376,10 @@ void mesh_mpath_table_grow(void) rcu_read_lock(); newtbl = mesh_table_alloc(rcu_dereference(mesh_paths)->size_order + 1); - if (!newtbl) + if (!newtbl) { + rcu_read_unlock(); return; + } write_lock_bh(&pathtbl_resize_lock); oldtbl = mesh_paths; if (mesh_table_grow(mesh_paths, newtbl) < 0) { @@ -400,8 +402,10 @@ void mesh_mpp_table_grow(void) rcu_read_lock(); newtbl = mesh_table_alloc(rcu_dereference(mpp_paths)->size_order + 1); - if (!newtbl) + if (!newtbl) { + rcu_read_unlock(); return; + } write_lock_bh(&pathtbl_resize_lock); oldtbl = mpp_paths; if (mesh_table_grow(mpp_paths, newtbl) < 0) {