lkml.org 
[lkml]   [2010]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH tip/core/rcu 05/13] net: add checking to rcu_dereference() primitives
From
2010/2/12 Eric Dumazet <eric.dumazet@gmail.com>:
> Le jeudi 11 février 2010 à 16:00 -0800, Paul E. McKenney a écrit :
[...]
>> @@ -1654,12 +1654,12 @@ static struct dn_route *dn_rt_cache_get_first(struct seq_file *seq)
>>
>>       for(s->bucket = dn_rt_hash_mask; s->bucket >= 0; --s->bucket) {
>>               rcu_read_lock_bh();
>> -             rt = dn_rt_hash_table[s->bucket].chain;
>> +             rt = rcu_dereference_bh(dn_rt_hash_table[s->bucket].chain);
>>               if (rt)
>>                       break;
>>               rcu_read_unlock_bh();
>>       }
>> -     return rcu_dereference(rt);
>> +     return rt;
>>  }

Isn't there a bug? Looks like data pointed to by rt should be
protected by RCU, but the rcu_read_lock is withdrawn before access.

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-02-14 09:37    [from the cache]
©2003-2011 Jasper Spaans