Message ID | 20200720081041.8711-1-jiri@resnulli.us |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | [net-next,v2] sched: sch_api: add missing rcu read lock to silence the warning | expand |
On Mon, Jul 20, 2020 at 1:10 AM Jiri Pirko <jiri@resnulli.us> wrote: > diff --git a/include/linux/hashtable.h b/include/linux/hashtable.h > index 78b6ea5fa8ba..f6c666730b8c 100644 > --- a/include/linux/hashtable.h > +++ b/include/linux/hashtable.h > @@ -173,9 +173,9 @@ static inline void hash_del_rcu(struct hlist_node *node) > * @member: the name of the hlist_node within the struct > * @key: the key of the objects to iterate over > */ I think you need to update the doc here too, that is adding @cond.
Tue, Jul 21, 2020 at 08:57:45PM CEST, xiyou.wangcong@gmail.com wrote: >On Mon, Jul 20, 2020 at 1:10 AM Jiri Pirko <jiri@resnulli.us> wrote: >> diff --git a/include/linux/hashtable.h b/include/linux/hashtable.h >> index 78b6ea5fa8ba..f6c666730b8c 100644 >> --- a/include/linux/hashtable.h >> +++ b/include/linux/hashtable.h >> @@ -173,9 +173,9 @@ static inline void hash_del_rcu(struct hlist_node *node) >> * @member: the name of the hlist_node within the struct >> * @key: the key of the objects to iterate over >> */ > >I think you need to update the doc here too, that is adding @cond. Ah, sure, will send v3. Thanks!
diff --git a/include/linux/hashtable.h b/include/linux/hashtable.h index 78b6ea5fa8ba..f6c666730b8c 100644 --- a/include/linux/hashtable.h +++ b/include/linux/hashtable.h @@ -173,9 +173,9 @@ static inline void hash_del_rcu(struct hlist_node *node) * @member: the name of the hlist_node within the struct * @key: the key of the objects to iterate over */ -#define hash_for_each_possible_rcu(name, obj, member, key) \ +#define hash_for_each_possible_rcu(name, obj, member, key, cond...) \ hlist_for_each_entry_rcu(obj, &name[hash_min(key, HASH_BITS(name))],\ - member) + member, ## cond) /** * hash_for_each_possible_rcu_notrace - iterate over all possible objects hashing diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 11ebba60da3b..2a76a2f5ed88 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -267,7 +267,8 @@ static struct Qdisc *qdisc_match_from_root(struct Qdisc *root, u32 handle) root->handle == handle) return root; - hash_for_each_possible_rcu(qdisc_dev(root)->qdisc_hash, q, hash, handle) { + hash_for_each_possible_rcu(qdisc_dev(root)->qdisc_hash, q, hash, handle, + lockdep_rtnl_is_held()) { if (q->handle == handle) return q; }