# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/05 22:14:18+01:00 kaber@coreworks.de # [PKT_SCHED]: Fix rcu_assign_pointer fallout, use it in the right place # # Signed-off-by: Patrick McHardy # # net/sched/sch_generic.c # 2004/11/05 22:14:08+01:00 kaber@coreworks.de +5 -7 # [PKT_SCHED]: Fix rcu_assign_pointer fallout, use it in the right place # # Signed-off-by: Patrick McHardy # # net/sched/sch_api.c # 2004/11/05 22:14:08+01:00 kaber@coreworks.de +2 -4 # [PKT_SCHED]: Fix rcu_assign_pointer fallout, use it in the right place # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c --- a/net/sched/sch_api.c 2004-11-05 22:29:06 +01:00 +++ b/net/sched/sch_api.c 2004-11-05 22:29:06 +01:00 @@ -451,11 +451,9 @@ else sch->handle = handle; - /* enqueue is accessed locklessly - make sure it's visible - * before we set a netdevice's qdisc pointer to sch */ if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS-1])) == 0) { qdisc_lock_tree(dev); - list_add_tail_rcu(&sch->list, &dev->qdisc_list); + list_add_tail(&sch->list, &dev->qdisc_list); qdisc_unlock_tree(dev); #ifdef CONFIG_NET_ESTIMATOR diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c --- a/net/sched/sch_generic.c 2004-11-05 22:29:06 +01:00 +++ b/net/sched/sch_generic.c 2004-11-05 22:29:06 +01:00 @@ -436,9 +436,6 @@ dev_hold(dev); sch->stats_lock = &dev->queue_lock; atomic_set(&sch->refcnt, 1); - /* enqueue is accessed locklessly - make sure it's visible - * before we set a netdevice's qdisc pointer to sch */ - smp_wmb(); if (!ops->init || ops->init(sch, NULL) == 0) return sch; @@ -519,7 +516,8 @@ } spin_lock_bh(&dev->queue_lock); - if ((dev->qdisc = dev->qdisc_sleeping) != &noqueue_qdisc) { + rcu_assign_pointer(dev->qdisc, dev->qdisc_sleeping); + if (dev->qdisc != &noqueue_qdisc) { dev->trans_start = jiffies; dev_watchdog_up(dev); }