diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-26 23:17:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-26 23:17:56 -0400 |
commit | 228428428138e231a155464239880201e5cc8b44 (patch) | |
tree | 89b437f5501d03ca36b717e232337426d0de77ca /net/sched | |
parent | 78681ac08a611313595d13cafabae1183b71ef48 (diff) | |
parent | 6c3b8fc618905d7599dcc514c99ce4293d476f39 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
netns: fix ip_rt_frag_needed rt_is_expired
netfilter: nf_conntrack_extend: avoid unnecessary "ct->ext" dereferences
netfilter: fix double-free and use-after free
netfilter: arptables in netns for real
netfilter: ip{,6}tables_security: fix future section mismatch
selinux: use nf_register_hooks()
netfilter: ebtables: use nf_register_hooks()
Revert "pkt_sched: sch_sfq: dump a real number of flows"
qeth: use dev->ml_priv instead of dev->priv
syncookies: Make sure ECN is disabled
net: drop unused BUG_TRAP()
net: convert BUG_TRAP to generic WARN_ON
drivers/net: convert BUG_TRAP to generic WARN_ON
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/act_api.c | 2 | ||||
-rw-r--r-- | net/sched/act_police.c | 2 | ||||
-rw-r--r-- | net/sched/cls_u32.c | 10 | ||||
-rw-r--r-- | net/sched/sch_cbq.c | 4 | ||||
-rw-r--r-- | net/sched/sch_generic.c | 2 | ||||
-rw-r--r-- | net/sched/sch_htb.c | 16 | ||||
-rw-r--r-- | net/sched/sch_sfq.c | 9 |
7 files changed, 19 insertions, 26 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 74e662cbb2c5..d308c19aa3f9 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c | |||
@@ -41,7 +41,7 @@ void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo) | |||
41 | return; | 41 | return; |
42 | } | 42 | } |
43 | } | 43 | } |
44 | BUG_TRAP(0); | 44 | WARN_ON(1); |
45 | } | 45 | } |
46 | EXPORT_SYMBOL(tcf_hash_destroy); | 46 | EXPORT_SYMBOL(tcf_hash_destroy); |
47 | 47 | ||
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 32c3f9d9fb7a..38015b493947 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
@@ -116,7 +116,7 @@ static void tcf_police_destroy(struct tcf_police *p) | |||
116 | return; | 116 | return; |
117 | } | 117 | } |
118 | } | 118 | } |
119 | BUG_TRAP(0); | 119 | WARN_ON(1); |
120 | } | 120 | } |
121 | 121 | ||
122 | static const struct nla_policy police_policy[TCA_POLICE_MAX + 1] = { | 122 | static const struct nla_policy police_policy[TCA_POLICE_MAX + 1] = { |
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 527db2559dd2..246f9065ce34 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
@@ -345,7 +345,7 @@ static int u32_delete_key(struct tcf_proto *tp, struct tc_u_knode* key) | |||
345 | } | 345 | } |
346 | } | 346 | } |
347 | } | 347 | } |
348 | BUG_TRAP(0); | 348 | WARN_ON(1); |
349 | return 0; | 349 | return 0; |
350 | } | 350 | } |
351 | 351 | ||
@@ -368,7 +368,7 @@ static int u32_destroy_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht) | |||
368 | struct tc_u_common *tp_c = tp->data; | 368 | struct tc_u_common *tp_c = tp->data; |
369 | struct tc_u_hnode **hn; | 369 | struct tc_u_hnode **hn; |
370 | 370 | ||
371 | BUG_TRAP(!ht->refcnt); | 371 | WARN_ON(ht->refcnt); |
372 | 372 | ||
373 | u32_clear_hnode(tp, ht); | 373 | u32_clear_hnode(tp, ht); |
374 | 374 | ||
@@ -380,7 +380,7 @@ static int u32_destroy_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht) | |||
380 | } | 380 | } |
381 | } | 381 | } |
382 | 382 | ||
383 | BUG_TRAP(0); | 383 | WARN_ON(1); |
384 | return -ENOENT; | 384 | return -ENOENT; |
385 | } | 385 | } |
386 | 386 | ||
@@ -389,7 +389,7 @@ static void u32_destroy(struct tcf_proto *tp) | |||
389 | struct tc_u_common *tp_c = tp->data; | 389 | struct tc_u_common *tp_c = tp->data; |
390 | struct tc_u_hnode *root_ht = xchg(&tp->root, NULL); | 390 | struct tc_u_hnode *root_ht = xchg(&tp->root, NULL); |
391 | 391 | ||
392 | BUG_TRAP(root_ht != NULL); | 392 | WARN_ON(root_ht == NULL); |
393 | 393 | ||
394 | if (root_ht && --root_ht->refcnt == 0) | 394 | if (root_ht && --root_ht->refcnt == 0) |
395 | u32_destroy_hnode(tp, root_ht); | 395 | u32_destroy_hnode(tp, root_ht); |
@@ -407,7 +407,7 @@ static void u32_destroy(struct tcf_proto *tp) | |||
407 | while ((ht = tp_c->hlist) != NULL) { | 407 | while ((ht = tp_c->hlist) != NULL) { |
408 | tp_c->hlist = ht->next; | 408 | tp_c->hlist = ht->next; |
409 | 409 | ||
410 | BUG_TRAP(ht->refcnt == 0); | 410 | WARN_ON(ht->refcnt != 0); |
411 | 411 | ||
412 | kfree(ht); | 412 | kfree(ht); |
413 | } | 413 | } |
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index f1d2f8ec8b4c..14954bf4a683 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -1175,7 +1175,7 @@ static void cbq_unlink_class(struct cbq_class *this) | |||
1175 | this->tparent->children = NULL; | 1175 | this->tparent->children = NULL; |
1176 | } | 1176 | } |
1177 | } else { | 1177 | } else { |
1178 | BUG_TRAP(this->sibling == this); | 1178 | WARN_ON(this->sibling != this); |
1179 | } | 1179 | } |
1180 | } | 1180 | } |
1181 | 1181 | ||
@@ -1699,7 +1699,7 @@ static void cbq_destroy_class(struct Qdisc *sch, struct cbq_class *cl) | |||
1699 | { | 1699 | { |
1700 | struct cbq_sched_data *q = qdisc_priv(sch); | 1700 | struct cbq_sched_data *q = qdisc_priv(sch); |
1701 | 1701 | ||
1702 | BUG_TRAP(!cl->filters); | 1702 | WARN_ON(cl->filters); |
1703 | 1703 | ||
1704 | tcf_destroy_chain(&cl->filter_list); | 1704 | tcf_destroy_chain(&cl->filter_list); |
1705 | qdisc_destroy(cl->q); | 1705 | qdisc_destroy(cl->q); |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 43abd4d27ea6..fd2a6cadb115 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -746,5 +746,5 @@ void dev_shutdown(struct net_device *dev) | |||
746 | { | 746 | { |
747 | netdev_for_each_tx_queue(dev, shutdown_scheduler_queue, &noop_qdisc); | 747 | netdev_for_each_tx_queue(dev, shutdown_scheduler_queue, &noop_qdisc); |
748 | shutdown_scheduler_queue(dev, &dev->rx_queue, NULL); | 748 | shutdown_scheduler_queue(dev, &dev->rx_queue, NULL); |
749 | BUG_TRAP(!timer_pending(&dev->watchdog_timer)); | 749 | WARN_ON(timer_pending(&dev->watchdog_timer)); |
750 | } | 750 | } |
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 30c999c61b01..75a40951c4f2 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -524,7 +524,7 @@ htb_change_class_mode(struct htb_sched *q, struct htb_class *cl, long *diff) | |||
524 | */ | 524 | */ |
525 | static inline void htb_activate(struct htb_sched *q, struct htb_class *cl) | 525 | static inline void htb_activate(struct htb_sched *q, struct htb_class *cl) |
526 | { | 526 | { |
527 | BUG_TRAP(!cl->level && cl->un.leaf.q && cl->un.leaf.q->q.qlen); | 527 | WARN_ON(cl->level || !cl->un.leaf.q || !cl->un.leaf.q->q.qlen); |
528 | 528 | ||
529 | if (!cl->prio_activity) { | 529 | if (!cl->prio_activity) { |
530 | cl->prio_activity = 1 << (cl->un.leaf.aprio = cl->un.leaf.prio); | 530 | cl->prio_activity = 1 << (cl->un.leaf.aprio = cl->un.leaf.prio); |
@@ -542,7 +542,7 @@ static inline void htb_activate(struct htb_sched *q, struct htb_class *cl) | |||
542 | */ | 542 | */ |
543 | static inline void htb_deactivate(struct htb_sched *q, struct htb_class *cl) | 543 | static inline void htb_deactivate(struct htb_sched *q, struct htb_class *cl) |
544 | { | 544 | { |
545 | BUG_TRAP(cl->prio_activity); | 545 | WARN_ON(!cl->prio_activity); |
546 | 546 | ||
547 | htb_deactivate_prios(q, cl); | 547 | htb_deactivate_prios(q, cl); |
548 | cl->prio_activity = 0; | 548 | cl->prio_activity = 0; |
@@ -757,7 +757,7 @@ static struct htb_class *htb_lookup_leaf(struct rb_root *tree, int prio, | |||
757 | u32 *pid; | 757 | u32 *pid; |
758 | } stk[TC_HTB_MAXDEPTH], *sp = stk; | 758 | } stk[TC_HTB_MAXDEPTH], *sp = stk; |
759 | 759 | ||
760 | BUG_TRAP(tree->rb_node); | 760 | WARN_ON(!tree->rb_node); |
761 | sp->root = tree->rb_node; | 761 | sp->root = tree->rb_node; |
762 | sp->pptr = pptr; | 762 | sp->pptr = pptr; |
763 | sp->pid = pid; | 763 | sp->pid = pid; |
@@ -777,7 +777,7 @@ static struct htb_class *htb_lookup_leaf(struct rb_root *tree, int prio, | |||
777 | *sp->pptr = (*sp->pptr)->rb_left; | 777 | *sp->pptr = (*sp->pptr)->rb_left; |
778 | if (sp > stk) { | 778 | if (sp > stk) { |
779 | sp--; | 779 | sp--; |
780 | BUG_TRAP(*sp->pptr); | 780 | WARN_ON(!*sp->pptr); |
781 | if (!*sp->pptr) | 781 | if (!*sp->pptr) |
782 | return NULL; | 782 | return NULL; |
783 | htb_next_rb_node(sp->pptr); | 783 | htb_next_rb_node(sp->pptr); |
@@ -792,7 +792,7 @@ static struct htb_class *htb_lookup_leaf(struct rb_root *tree, int prio, | |||
792 | sp->pid = cl->un.inner.last_ptr_id + prio; | 792 | sp->pid = cl->un.inner.last_ptr_id + prio; |
793 | } | 793 | } |
794 | } | 794 | } |
795 | BUG_TRAP(0); | 795 | WARN_ON(1); |
796 | return NULL; | 796 | return NULL; |
797 | } | 797 | } |
798 | 798 | ||
@@ -810,7 +810,7 @@ static struct sk_buff *htb_dequeue_tree(struct htb_sched *q, int prio, | |||
810 | 810 | ||
811 | do { | 811 | do { |
812 | next: | 812 | next: |
813 | BUG_TRAP(cl); | 813 | WARN_ON(!cl); |
814 | if (!cl) | 814 | if (!cl) |
815 | return NULL; | 815 | return NULL; |
816 | 816 | ||
@@ -1185,7 +1185,7 @@ static void htb_parent_to_leaf(struct htb_sched *q, struct htb_class *cl, | |||
1185 | { | 1185 | { |
1186 | struct htb_class *parent = cl->parent; | 1186 | struct htb_class *parent = cl->parent; |
1187 | 1187 | ||
1188 | BUG_TRAP(!cl->level && cl->un.leaf.q && !cl->prio_activity); | 1188 | WARN_ON(cl->level || !cl->un.leaf.q || cl->prio_activity); |
1189 | 1189 | ||
1190 | if (parent->cmode != HTB_CAN_SEND) | 1190 | if (parent->cmode != HTB_CAN_SEND) |
1191 | htb_safe_rb_erase(&parent->pq_node, q->wait_pq + parent->level); | 1191 | htb_safe_rb_erase(&parent->pq_node, q->wait_pq + parent->level); |
@@ -1205,7 +1205,7 @@ static void htb_parent_to_leaf(struct htb_sched *q, struct htb_class *cl, | |||
1205 | static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl) | 1205 | static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl) |
1206 | { | 1206 | { |
1207 | if (!cl->level) { | 1207 | if (!cl->level) { |
1208 | BUG_TRAP(cl->un.leaf.q); | 1208 | WARN_ON(!cl->un.leaf.q); |
1209 | qdisc_destroy(cl->un.leaf.q); | 1209 | qdisc_destroy(cl->un.leaf.q); |
1210 | } | 1210 | } |
1211 | gen_kill_estimator(&cl->bstats, &cl->rate_est); | 1211 | gen_kill_estimator(&cl->bstats, &cl->rate_est); |
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index 73f53844ce97..8589da666568 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -536,14 +536,7 @@ static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb) | |||
536 | 536 | ||
537 | opt.limit = q->limit; | 537 | opt.limit = q->limit; |
538 | opt.divisor = SFQ_HASH_DIVISOR; | 538 | opt.divisor = SFQ_HASH_DIVISOR; |
539 | opt.flows = 0; | 539 | opt.flows = q->limit; |
540 | if (q->tail != SFQ_DEPTH) { | ||
541 | unsigned int i; | ||
542 | |||
543 | for (i = 0; i < SFQ_HASH_DIVISOR; i++) | ||
544 | if (q->ht[i] != SFQ_DEPTH) | ||
545 | opt.flows++; | ||
546 | } | ||
547 | 540 | ||
548 | NLA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt); | 541 | NLA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt); |
549 | 542 | ||