summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYunsheng Lin <linyunsheng@huawei.com>2020-11-03 11:25:38 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-18 19:20:33 +0100
commitebc24aeb86942d5700fa05cbd288a16dc9bde0ff (patch)
treea96f9a3f85d11c8b7c10e3db32872103cc473949
parentc5cf5c7b585c7f48195892e44b76237010c0747a (diff)
downloadlinux-stable-ebc24aeb86942d5700fa05cbd288a16dc9bde0ff.tar.gz
linux-stable-ebc24aeb86942d5700fa05cbd288a16dc9bde0ff.tar.bz2
linux-stable-ebc24aeb86942d5700fa05cbd288a16dc9bde0ff.zip
net: sch_generic: fix the missing new qdisc assignment bug
When commit 2fb541c862c9 ("net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc") is backported to stable kernel, one assignment is missing, which causes two problems reported by Joakim and Vishwanath, see [1] and [2]. So add the assignment back to fix it. 1. https://www.spinics.net/lists/netdev/msg693916.html 2. https://www.spinics.net/lists/netdev/msg695131.html Fixes: 749cc0b0c7f3 ("net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc") Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Tested-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/sched/sch_generic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 0e275e11f511..6e6147a81bc3 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -1127,10 +1127,13 @@ static void dev_deactivate_queue(struct net_device *dev,
void *_qdisc_default)
{
struct Qdisc *qdisc = rtnl_dereference(dev_queue->qdisc);
+ struct Qdisc *qdisc_default = _qdisc_default;
if (qdisc) {
if (!(qdisc->flags & TCQ_F_BUILTIN))
set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state);
+
+ rcu_assign_pointer(dev_queue->qdisc, qdisc_default);
}
}