From patchwork Tue Nov 17 13:06:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 328107 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70947C83010 for ; Tue, 17 Nov 2020 13:51:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0AD3B208CA for ; Tue, 17 Nov 2020 13:51:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="JHoZE/ji" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727956AbgKQNvq (ORCPT ); Tue, 17 Nov 2020 08:51:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:38270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731590AbgKQN32 (ORCPT ); Tue, 17 Nov 2020 08:29:28 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1AC7C20867; Tue, 17 Nov 2020 13:29:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619767; bh=CZUlol3hGzi6v2IfAhVY9tqlwE3X+cRnwC0wg/E1JYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JHoZE/jihNFC9Z6QKtJupEIvX0VSWrHjfYlFbcSLQ8ChiA3UXGBHvCc+UbDIUB6rW ibmFhIICFAI+rElQhtxtb5Ph0Ha6v3zlTvuL1lL+YUUBKU1JvK6a8lXlwWjWv9cPSL UI3VKL7dGFHWAevqUSXBLqyOkO1f0VJmu76rvHPE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yunsheng Lin , Jakub Kicinski , Brian Norris Subject: [PATCH 5.4 150/151] net: sch_generic: fix the missing new qdisc assignment bug Date: Tue, 17 Nov 2020 14:06:20 +0100 Message-Id: <20201117122128.728544855@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122121.381905960@linuxfoundation.org> References: <20201117122121.381905960@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 Acked-by: Jakub Kicinski Tested-by: Brian Norris Signed-off-by: Greg Kroah-Hartman --- net/sched/sch_generic.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -1127,10 +1127,13 @@ static void dev_deactivate_queue(struct 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); } }