From 07ccf8cd841e817157d5548038125dc8ea498a75 Mon Sep 17 00:00:00 2001 From: Jarek Poplawski Date: Sun, 15 Mar 2009 20:00:19 -0700 Subject: [PATCH] --- yaml --- r: 135212 b: refs/heads/master c: 7cd0a63872ac6ef97265f07adc367ca4f984468e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/sched/sch_cbq.c | 7 +++++-- trunk/net/sched/sch_drr.c | 7 +++++-- trunk/net/sched/sch_hfsc.c | 7 +++++-- trunk/net/sched/sch_htb.c | 7 +++++-- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 9c35557d45dd..c4ed390daafc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8bdd663aba341c15cd2fa9dbd7061b8b387964dc +refs/heads/master: 7cd0a63872ac6ef97265f07adc367ca4f984468e diff --git a/trunk/net/sched/sch_cbq.c b/trunk/net/sched/sch_cbq.c index 9e43ed949167..d728d8111732 100644 --- a/trunk/net/sched/sch_cbq.c +++ b/trunk/net/sched/sch_cbq.c @@ -1960,8 +1960,11 @@ static int cbq_delete(struct Qdisc *sch, unsigned long arg) cbq_rmprio(q, cl); sch_tree_unlock(sch); - if (--cl->refcnt == 0) - cbq_destroy_class(sch, cl); + BUG_ON(--cl->refcnt == 0); + /* + * This shouldn't happen: we "hold" one cops->get() when called + * from tc_ctl_tclass; the destroy method is done from cops->put(). + */ return 0; } diff --git a/trunk/net/sched/sch_drr.c b/trunk/net/sched/sch_drr.c index e36e94ab4e10..7597fe146866 100644 --- a/trunk/net/sched/sch_drr.c +++ b/trunk/net/sched/sch_drr.c @@ -155,8 +155,11 @@ static int drr_delete_class(struct Qdisc *sch, unsigned long arg) drr_purge_queue(cl); qdisc_class_hash_remove(&q->clhash, &cl->common); - if (--cl->refcnt == 0) - drr_destroy_class(sch, cl); + BUG_ON(--cl->refcnt == 0); + /* + * This shouldn't happen: we "hold" one cops->get() when called + * from tc_ctl_tclass; the destroy method is done from cops->put(). + */ sch_tree_unlock(sch); return 0; diff --git a/trunk/net/sched/sch_hfsc.c b/trunk/net/sched/sch_hfsc.c index 74226b265528..5022f9c1f34b 100644 --- a/trunk/net/sched/sch_hfsc.c +++ b/trunk/net/sched/sch_hfsc.c @@ -1139,8 +1139,11 @@ hfsc_delete_class(struct Qdisc *sch, unsigned long arg) hfsc_purge_queue(sch, cl); qdisc_class_hash_remove(&q->clhash, &cl->cl_common); - if (--cl->refcnt == 0) - hfsc_destroy_class(sch, cl); + BUG_ON(--cl->refcnt == 0); + /* + * This shouldn't happen: we "hold" one cops->get() when called + * from tc_ctl_tclass; the destroy method is done from cops->put(). + */ sch_tree_unlock(sch); return 0; diff --git a/trunk/net/sched/sch_htb.c b/trunk/net/sched/sch_htb.c index 355974f610c5..88cd02626621 100644 --- a/trunk/net/sched/sch_htb.c +++ b/trunk/net/sched/sch_htb.c @@ -1275,8 +1275,11 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg) if (last_child) htb_parent_to_leaf(q, cl, new_q); - if (--cl->refcnt == 0) - htb_destroy_class(sch, cl); + BUG_ON(--cl->refcnt == 0); + /* + * This shouldn't happen: we "hold" one cops->get() when called + * from tc_ctl_tclass; the destroy method is done from cops->put(). + */ sch_tree_unlock(sch); return 0;