[NET_SCHED]: Fix endless loops (part 2): "simple" qdiscs
Convert the "simple" qdiscs to use qdisc_tree_decrease_qlen() where necessary: - all graft operations - destruction of old child qdiscs in prio, red and tbf change operation - purging of queue in sfq change operation Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
43effa1e57
commit
5e50da01d0
@@ -229,8 +229,10 @@ static int red_change(struct Qdisc *sch, struct rtattr *opt)
|
||||
sch_tree_lock(sch);
|
||||
q->flags = ctl->flags;
|
||||
q->limit = ctl->limit;
|
||||
if (child)
|
||||
if (child) {
|
||||
qdisc_tree_decrease_qlen(q->qdisc, q->qdisc->q.qlen);
|
||||
qdisc_destroy(xchg(&q->qdisc, child));
|
||||
}
|
||||
|
||||
red_set_parms(&q->parms, ctl->qth_min, ctl->qth_max, ctl->Wlog,
|
||||
ctl->Plog, ctl->Scell_log,
|
||||
@@ -308,8 +310,8 @@ static int red_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
|
||||
|
||||
sch_tree_lock(sch);
|
||||
*old = xchg(&q->qdisc, new);
|
||||
qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
|
||||
qdisc_reset(*old);
|
||||
sch->q.qlen = 0;
|
||||
sch_tree_unlock(sch);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user