diff mbox

mesh RCU issues

Message ID BANLkTinYGGnGoE2jeuAmEYGW7HyBsV2+BA@mail.gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Javier Cardona May 14, 2011, 3:52 a.m. UTC
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?




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

Comments

Johannes Berg May 14, 2011, 8:24 a.m. UTC | #1
On Fri, 2011-05-13 at 20:52 -0700, Javier Cardona wrote:

> > With this patch, I get the warnings below.
> 
> Thanks.  Any ideas on how to fix sparse?  I'd like to see those too :)

No, not really, what version are you using? I'm on 64 bit so I don't
have uaccess_32.h included I guess, I suppose you could just go to that
file and comment out the contents of the copy_from_user_overflow()
function that seems to be causing it grief.

> > The locking ones are definitely genuine bugs,
> 
> I'm not sure I fully understand the sparse message... would this fix
> the two locking warnings?
[snip]

Sure, those locking fixes should fix the bugs and get rid of the
warnings unless there was another code path leaving w/o unlock.

johannes

--
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 mbox

Patch

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