linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Javier Cardona <javier@cozybit.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	devel@lists.open80211s.org
Subject: Re: mesh RCU issues
Date: Fri, 13 May 2011 20:52:39 -0700	[thread overview]
Message-ID: <BANLkTinYGGnGoE2jeuAmEYGW7HyBsV2+BA@mail.gmail.com> (raw)
In-Reply-To: <1305331247.680.7.camel@jlt3.sipsolutions.net>

On Fri, May 13, 2011 at 5:00 PM, Johannes Berg
<johannes@sipsolutions.net> 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?

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) {



Javier

  reply	other threads:[~2011-05-14  3:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-12 12:25 mesh RCU issues Johannes Berg
2011-05-12 13:03 ` [PATCH] mac80211: remove pointless mesh path timer RCU code Johannes Berg
2011-05-12 22:26 ` mesh RCU issues Javier Cardona
2011-05-13  7:13   ` Johannes Berg
2011-05-13 20:28     ` Javier Cardona
2011-05-13 23:30       ` Johannes Berg
2011-05-14  0:00       ` Johannes Berg
2011-05-14  3:52         ` Javier Cardona [this message]
2011-05-14  8:24           ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTinYGGnGoE2jeuAmEYGW7HyBsV2+BA@mail.gmail.com \
    --to=javier@cozybit.com \
    --cc=devel@lists.open80211s.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).