Received: by 10.192.165.148 with SMTP id m20csp828631imm; Fri, 27 Apr 2018 08:09:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqYpNZOrx0fi8AIyX8usml0RugGZG9RLuoD7o7fyucvvjXWiojjyieSZDGfwtrS7ghQ+Pte X-Received: by 2002:a65:55ca:: with SMTP id k10-v6mr2507537pgs.422.1524841758210; Fri, 27 Apr 2018 08:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524841758; cv=none; d=google.com; s=arc-20160816; b=ORx4UNSx+S4D1JYElEh6A9spzpOasOeicH76Kxstnx7O10HX2A1IXYelb+WanuGEqe rFDS6vuJ67GpaDkOd4VhlatG2Mzlg7FEIG9W8aVd2SAxw0+YYxeSA3ftsUt+tQmvtAuN GXis9VdqrgrcQMH8Hnwe3QbcT9e3YIwi9buiLaYTwu5So/gPaGct7CXqeYTyne2A3uWM gm4NY6bpy+KZVgP225Fa88Q9BwrQKOWl9sD1luMjCOYFjbJOF78sCBZWTtHySZj8WA9E dwQJ1gBUlR7qmUVWu5njSyfiKxxVeWD50OdjrEEmAeqphDX8hpMj92QhJq1FHr2p3i5s fJaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=Tpia8S4uxEvecXVZ43Rf4lQYHHPN+LAi7lT5yU0MYEs=; b=mpOxLXSRtv3LOBoLK87ArO1jm4mj0RnX8AHMnPzS8J5abUfdy6pcEOQf1mHDMljSMB u18l4UykX/GlXPv4joEpPUHrrIYirnm8U2WVyA5tQ46u02d/0qCu40lYNoTSBqmeNwtZ VpLZbrL7IO5GjvpzrR6FgYdJ8zrnfKMRM1Exm1nk6ZusWVDZcEK+kQmoci+njLBAocOQ ZwDGyP3E2nGwRYhM7QI2bd2ntAuF2yAQ8JiYo7o6oQWqbKNnJZX+8f/1hKBYcitT7I38 T68rcM5pJTsfzZNMT5UAjAG2jOdgDoTOjaPAmeZ+TUnqvPUDoT7p/sy5Jfx+RqNYEmKv nvRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w33-v6si1378079plb.431.2018.04.27.08.09.03; Fri, 27 Apr 2018 08:09:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933734AbeD0OEf (ORCPT + 99 others); Fri, 27 Apr 2018 10:04:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:50842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933706AbeD0OEb (ORCPT ); Fri, 27 Apr 2018 10:04:31 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 BF35621890; Fri, 27 Apr 2018 14:04:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF35621890 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xin Long , "David S. Miller" Subject: [PATCH 4.9 47/74] bonding: do not set slave_dev npinfo before slave_enable_netpoll in bond_enslave Date: Fri, 27 Apr 2018 15:58:37 +0200 Message-Id: <20180427135711.876315795@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135709.899303463@linuxfoundation.org> References: <20180427135709.899303463@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xin Long [ Upstream commit ddea788c63094f7c483783265563dd5b50052e28 ] After Commit 8a8efa22f51b ("bonding: sync netpoll code with bridge"), it would set slave_dev npinfo in slave_enable_netpoll when enslaving a dev if bond->dev->npinfo was set. However now slave_dev npinfo is set with bond->dev->npinfo before calling slave_enable_netpoll. With slave_dev npinfo set, __netpoll_setup called in slave_enable_netpoll will not call slave dev's .ndo_netpoll_setup(). It causes that the lower dev of this slave dev can't set its npinfo. One way to reproduce it: # modprobe bonding # brctl addbr br0 # brctl addif br0 eth1 # ifconfig bond0 192.168.122.1/24 up # ifenslave bond0 eth2 # systemctl restart netconsole # ifenslave bond0 br0 # ifconfig eth2 down # systemctl restart netconsole The netpoll won't really work. This patch is to remove that slave_dev npinfo setting in bond_enslave(). Fixes: 8a8efa22f51b ("bonding: sync netpoll code with bridge") Signed-off-by: Xin Long Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/bonding/bond_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1654,8 +1654,7 @@ int bond_enslave(struct net_device *bond } /* switch(bond_mode) */ #ifdef CONFIG_NET_POLL_CONTROLLER - slave_dev->npinfo = bond->dev->npinfo; - if (slave_dev->npinfo) { + if (bond->dev->npinfo) { if (slave_enable_netpoll(new_slave)) { netdev_info(bond_dev, "master_dev is using netpoll, but new slave device does not support netpoll\n"); res = -EBUSY;