From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 6A535C282C4 for ; Mon, 4 Feb 2019 10:57:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3728C2082E for ; Mon, 4 Feb 2019 10:57:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549277844; bh=DHzTtT0rNz/VpJaHMB7JrISdTWdKHnTranTVa9grBr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=r43safRThr4gnOEznYtIZPCrjrU1Z9KSW8zYFttMOmK2n9K6TS4HhPoYaRxfggpsk E22s9tQ/ewrkgQiriNqPzriBTZufxUJ3hhmeapr+e5THaRnAmYIYRxCwBRKA9ZBNzu Hzo7HCEDqpGSyqchPCow+gCU4vMHLjtXUEdKKS4c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732463AbfBDKvt (ORCPT ); Mon, 4 Feb 2019 05:51:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:49568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732417AbfBDKvr (ORCPT ); Mon, 4 Feb 2019 05:51:47 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 989712070C; Mon, 4 Feb 2019 10:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549277507; bh=DHzTtT0rNz/VpJaHMB7JrISdTWdKHnTranTVa9grBr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M46KmnQfT9rO+QHmlbqS3RFmsWTh0P+Mhlep9pDMMjHgh677HUpQmN0HMi0lLa5wy zngB7t7qpj/n2Y/iE0w20P5enP0LxvtymcgCeFbF6VfhwyLxZvnrGNZyHiU3+qbdz4 O05YukXTzKAh1uyWnyj5z3vW71+Y8+vL0V7j+WmI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, George Amanakis , Stanislav Fomichev , "David S. Miller" Subject: [PATCH 4.20 15/80] tun: move the call to tun_set_real_num_queues Date: Mon, 4 Feb 2019 11:36:35 +0100 Message-Id: <20190204103622.513162923@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204103620.287366543@linuxfoundation.org> References: <20190204103620.287366543@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: George Amanakis [ Upstream commit 3a03cb8456cc1d61c467a5375e0a10e5207b948c ] Call tun_set_real_num_queues() after the increment of tun->numqueues since the former depends on it. Otherwise, the number of queues is not correctly accounted for, which results to warnings similar to: "vnet0 selects TX queue 11, but real number of TX queues is 11". Fixes: 0b7959b62573 ("tun: publish tfile after it's fully initialized") Reported-and-tested-by: George Amanakis Signed-off-by: George Amanakis Signed-off-by: Stanislav Fomichev Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/tun.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -862,8 +862,6 @@ static int tun_attach(struct tun_struct if (rtnl_dereference(tun->xdp_prog)) sock_set_flag(&tfile->sk, SOCK_XDP); - tun_set_real_num_queues(tun); - /* device is allowed to go away first, so no need to hold extra * refcnt. */ @@ -875,6 +873,7 @@ static int tun_attach(struct tun_struct rcu_assign_pointer(tfile->tun, tun); rcu_assign_pointer(tun->tfiles[tun->numqueues], tfile); tun->numqueues++; + tun_set_real_num_queues(tun); out: return err; }