mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 14:51:51 -04:00
net/sched: sch_fq_codel: remove data-races from fq_codel_dump_stats()
fq_codel_dump_stats() acquires the qdisc spinlock a bit too late.
Move this acquisition before we fill st.qdisc_stats with live data.
Fixes: edb09eb17e ("net: sched: do not acquire qdisc spinlock in qdisc/class stats dump")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://patch.msgid.link/20260421142509.3967231-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
5154561d9b
commit
bbfaa73ea6
@@ -585,6 +585,8 @@ static int fq_codel_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
|
||||
};
|
||||
struct list_head *pos;
|
||||
|
||||
sch_tree_lock(sch);
|
||||
|
||||
st.qdisc_stats.maxpacket = q->cstats.maxpacket;
|
||||
st.qdisc_stats.drop_overlimit = q->drop_overlimit;
|
||||
st.qdisc_stats.ecn_mark = q->cstats.ecn_mark;
|
||||
@@ -593,7 +595,6 @@ static int fq_codel_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
|
||||
st.qdisc_stats.memory_usage = q->memory_usage;
|
||||
st.qdisc_stats.drop_overmemory = q->drop_overmemory;
|
||||
|
||||
sch_tree_lock(sch);
|
||||
list_for_each(pos, &q->new_flows)
|
||||
st.qdisc_stats.new_flows_len++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user