pkt_sched: Fix locking of qdisc_root with qdisc_root_sleeping_lock()
Use qdisc_root_sleeping_lock() instead of qdisc_root_lock() where appropriate. The only difference is while dev is deactivated, when currently we can use a sleeping qdisc with the lock of noop_qdisc. This shouldn't be dangerous since after deactivation root lock could be used only by gen_estimator code, but looks wrong anyway. Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
3cc76caa98
commit
102396ae65
@@ -1169,8 +1169,8 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
|
||||
if (q->stab && qdisc_dump_stab(skb, q->stab) < 0)
|
||||
goto nla_put_failure;
|
||||
|
||||
if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS,
|
||||
TCA_XSTATS, qdisc_root_lock(q), &d) < 0)
|
||||
if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS,
|
||||
qdisc_root_sleeping_lock(q), &d) < 0)
|
||||
goto nla_put_failure;
|
||||
|
||||
if (q->ops->dump_stats && q->ops->dump_stats(q, &d) < 0)
|
||||
@@ -1461,8 +1461,8 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
|
||||
if (cl_ops->dump && cl_ops->dump(q, cl, skb, tcm) < 0)
|
||||
goto nla_put_failure;
|
||||
|
||||
if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS,
|
||||
TCA_XSTATS, qdisc_root_lock(q), &d) < 0)
|
||||
if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS,
|
||||
qdisc_root_sleeping_lock(q), &d) < 0)
|
||||
goto nla_put_failure;
|
||||
|
||||
if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0)
|
||||
|
Reference in New Issue
Block a user