aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_generic.c
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2008-08-22 06:24:05 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-22 06:31:39 -0400
commitf6e0b239a2657ea8cb67f0d83d0bfdbfd19a481b (patch)
tree9d6e3c97a81869fde3958cdbcf431ee3739f9b2c /net/sched/sch_generic.c
parent2540e0511ea17e25831be543cdf9381e6209950d (diff)
pkt_sched: Fix qdisc list locking
Since some qdiscs call qdisc_tree_decrease_qlen() (so qdisc_lookup()) without rtnl_lock(), adding and deleting from a qdisc list needs additional locking. This patch adds global spinlock qdisc_list_lock and wrapper functions for modifying the list. It is considered as a temporary solution until hfsc_dequeue(), netem_dequeue() and tbf_dequeue() (or qdisc_tree_decrease_qlen()) are redone. With feedback from Herbert Xu and David S. Miller. Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_generic.c')
-rw-r--r--net/sched/sch_generic.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index c3ed4d44fc14..5f0ade7806a7 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -526,10 +526,9 @@ void qdisc_destroy(struct Qdisc *qdisc)
526 !atomic_dec_and_test(&qdisc->refcnt)) 526 !atomic_dec_and_test(&qdisc->refcnt))
527 return; 527 return;
528 528
529 if (qdisc->parent)
530 list_del(&qdisc->list);
531
532#ifdef CONFIG_NET_SCHED 529#ifdef CONFIG_NET_SCHED
530 qdisc_list_del(qdisc);
531
533 qdisc_put_stab(qdisc->stab); 532 qdisc_put_stab(qdisc->stab);
534#endif 533#endif
535 gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est); 534 gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est);