Commit 814a175e authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NET_SCHED]: sch_htb: perform qlen adjustment immediately in ->delete

qlen adjustment should happen immediately in ->delete and not in the
class destroy function because the reference count will not hit zero in
->delete (sch_api holds a reference) but in ->put. Since the qdisc
lock is released between deletion of the class and final destruction
this creates an externally visible error in the qlen counter.
Signed-off-by: default avatarPatrick McHardy <>
Signed-off-by: default avatarDavid S. Miller <>
parent 6cbda6b6
......@@ -1269,9 +1269,9 @@ static void htb_destroy_filters(struct tcf_proto **fl)
static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl)
struct htb_sched *q = qdisc_priv(sch);
if (!cl->level) {
sch->q.qlen -= cl->un.leaf.q->q.qlen;
......@@ -1334,6 +1334,11 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg)
/* delete from hash and active; remainder in destroy_class */
if (!cl->level) {
sch->q.qlen -= cl->un.leaf.q->q.qlen;
if (cl->prio_activity)
htb_deactivate(q, cl);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment