Skip to content

Commit bbfaa73

Browse files
edumazetkuba-moo
authored andcommitted
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: edb09eb ("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>
1 parent 5154561 commit bbfaa73

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/sched/sch_fq_codel.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,8 @@ static int fq_codel_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
585585
};
586586
struct list_head *pos;
587587

588+
sch_tree_lock(sch);
589+
588590
st.qdisc_stats.maxpacket = q->cstats.maxpacket;
589591
st.qdisc_stats.drop_overlimit = q->drop_overlimit;
590592
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)
593595
st.qdisc_stats.memory_usage = q->memory_usage;
594596
st.qdisc_stats.drop_overmemory = q->drop_overmemory;
595597

596-
sch_tree_lock(sch);
597598
list_for_each(pos, &q->new_flows)
598599
st.qdisc_stats.new_flows_len++;
599600

0 commit comments

Comments
 (0)