aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_cbq.c
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2008-08-27 05:25:17 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-27 05:25:17 -0400
commitf6f9b93f1624206c802ac9162c9302edaf59bfd9 (patch)
tree643bd211bf909118311138e588a78834fad7a40d /net/sched/sch_cbq.c
parentf7a54c13c7b072d9426bd5cec1cdb8306df5ef55 (diff)
pkt_sched: Fix gen_estimator locks
While passing a qdisc root lock to gen_new_estimator() and gen_replace_estimator() dev could be deactivated or even before grafting proper root qdisc as qdisc_sleeping (e.g. qdisc_create), so using qdisc_root_lock() is not enough. This patch adds qdisc_root_sleeping_lock() for this, plus additional checks, where necessary. Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r--net/sched/sch_cbq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 8fa90d68ec6d..9b720adedead 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1839,7 +1839,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
1839 1839
1840 if (tca[TCA_RATE]) 1840 if (tca[TCA_RATE])
1841 gen_replace_estimator(&cl->bstats, &cl->rate_est, 1841 gen_replace_estimator(&cl->bstats, &cl->rate_est,
1842 qdisc_root_lock(sch), 1842 qdisc_root_sleeping_lock(sch),
1843 tca[TCA_RATE]); 1843 tca[TCA_RATE]);
1844 return 0; 1844 return 0;
1845 } 1845 }
@@ -1930,7 +1930,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
1930 1930
1931 if (tca[TCA_RATE]) 1931 if (tca[TCA_RATE])
1932 gen_new_estimator(&cl->bstats, &cl->rate_est, 1932 gen_new_estimator(&cl->bstats, &cl->rate_est,
1933 qdisc_root_lock(sch), tca[TCA_RATE]); 1933 qdisc_root_sleeping_lock(sch), tca[TCA_RATE]);
1934 1934
1935 *arg = (unsigned long)cl; 1935 *arg = (unsigned long)cl;
1936 return 0; 1936 return 0;