pkt_sched: Destroy gen estimators under rtnl_lock().
gen_kill_estimator() requires rtnl_lock() protection, and since it is
called in qdisc ->destroy() too, this has to go back from RCU callback
to qdisc_destroy().Signed-off-by: Jarek Poplawski
---
net/sched/sch_generic.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 7cf83b3..336dc88 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -524,18 +524,10 @@ EXPORT_SYMBOL(qdisc_reset);
static void __qdisc_destroy(struct rcu_head *head)
{
struct Qdisc *qdisc = container_of(head, struct Qdisc, q_rcu);
- const struct Qdisc_ops *ops = qdisc->ops;#ifdef CONFIG_NET_SCHED
qdisc_put_stab(qdisc->stab);
#endif
- gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est);
- if (ops->reset)
- ops->reset(qdisc);
- if (ops->destroy)
- ops->destroy(qdisc);
-
- module_put(ops->owner);
dev_put(qdisc_dev(qdisc));kfree_skb(qdisc->gso_skb);
@@ -547,6 +539,8 @@ static void __qdisc_destroy(struct rcu_head *head)void qdisc_destroy(struct Qdisc *qdisc)
{
+ const struct Qdisc_ops *ops = qdisc->ops;
+
if (qdisc->flags & TCQ_F_BUILTIN ||
!atomic_dec_and_test(&qdisc->refcnt))
return;
@@ -554,6 +548,13 @@ void qdisc_destroy(struct Qdisc *qdisc)
if (qdisc->parent)
list_del(&qdisc->list);+ gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est);
+ if (ops->reset)
+ ops->reset(qdisc);
+ if (ops->destroy)
+ ops->destroy(qdisc);
+
+ module_put(ops->owner);
call_rcu(&qdisc->q_rcu, __qdisc_destroy);
}
EXPORT_SYMBOL(qdisc_destroy);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Jeff Garzik | [PATCH 1/9] irq-remove: core |
| Jamie Lokier | Re: POHMELFS high performance network filesystem. Transactions, failover, performa... |
| Dave Young | Re: 2.6.24-rc3-mm1 |
| Willy Tarreau | Re: From 2.4 to 2.6 to 2.7? |
git: | |
| Dan Miner | Compilation speeds (was Re: No patchlevel 3.} |
| Ian Jackson | RFD: comp.os.linux split |
| X X | X11 GIf viewer somewhere? |
| root | Broken pipe when using reboot/halt, etc. |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
