2018-09-13 11:58:26

by Haakon Bugge

[permalink] [raw]
Subject: mutex and rcu list traversal idiosyncrasy

Hi Faisal,


In commit f27b4746f378 ("i40iw: add connection management code") you have in i40iw_add_mqh_6():

rtnl_lock();
for_each_netdev_rcu(...) {
[]
}
rtnl_unlock();

Shouldn't this read:

rtnl_lock();
for_each_netdev(...) {
[]
}
rtnl_unlock();

or

rcu_read_lock();
for_each_netdev_rcu(...) {
[]
}
rcu_read_unlock();


?



Thx, HÃ¥kon




2018-09-14 23:47:31

by Saleem, Shiraz

[permalink] [raw]
Subject: Re: mutex and rcu list traversal idiosyncrasy

On Thu, Sep 13, 2018 at 05:55:44AM -0600, H?kon Bugge wrote:
> Hi Faisal,
>
>
> In commit f27b4746f378 ("i40iw: add connection management code") you have in i40iw_add_mqh_6():
>
> rtnl_lock();
> for_each_netdev_rcu(...) {
> []
> }
> rtnl_unlock();
>
> Shouldn't this read:
> rtnl_lock();
> for_each_netdev(...) {
> []
> }
> rtnl_unlock();
>

Yes.