diff options
author | Patrick McHardy <kaber@trash.net> | 2006-11-30 02:36:20 +0100 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 06:31:43 +0100 |
commit | 5e50da01d0ce7ef0ba3ed6cfabd62f327da0aca6 (patch) | |
tree | 6f2205ceae40a7fd5b498e94c60b65140740a027 /net/sched/sch_tbf.c | |
parent | [NET_SCHED]: Fix endless loops caused by inaccurate qlen counters (part 1) (diff) | |
download | linux-5e50da01d0ce7ef0ba3ed6cfabd62f327da0aca6.tar.xz linux-5e50da01d0ce7ef0ba3ed6cfabd62f327da0aca6.zip |
[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>
Diffstat (limited to 'net/sched/sch_tbf.c')
-rw-r--r-- | net/sched/sch_tbf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 2562a6040b76..23b7624354f5 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c @@ -348,8 +348,10 @@ static int tbf_change(struct Qdisc* sch, struct rtattr *opt) } sch_tree_lock(sch); - if (child) + if (child) { + qdisc_tree_decrease_qlen(q->qdisc, q->qdisc->q.qlen); qdisc_destroy(xchg(&q->qdisc, child)); + } q->limit = qopt->limit; q->mtu = qopt->mtu; q->max_size = max_size; @@ -451,8 +453,8 @@ static int tbf_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; |