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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 602A5C2D0DA for ; Fri, 27 Dec 2019 18:05:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3523120CC7 for ; Fri, 27 Dec 2019 18:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577469919; bh=p4Mv2ibaTAv66XQ1VweCtPx1o/WJgXnt76oOV1RZJfk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HjNQAdK5o3et2UWdyrfgN6OCm1LPrQgnL5xjxqTF/xRa5RAF6aBseN9YkAj1tApMI 3xuNQNJpr6fzTqD7Y52A8FFcGYMqyBs+hT1r3RUY8o8IRARSNm65oh/VCC0YbR+C+s 5uNjDJW0w0YEWu24JASkSzaHgz+d1Dnb7z3xeZFg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728729AbfL0SFS (ORCPT ); Fri, 27 Dec 2019 13:05:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:60194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728189AbfL0SDE (ORCPT ); Fri, 27 Dec 2019 13:03:04 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 132F9206F4; Fri, 27 Dec 2019 18:03:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577469783; bh=p4Mv2ibaTAv66XQ1VweCtPx1o/WJgXnt76oOV1RZJfk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xvxw+qftUH0pZoUBJO7/aOyPfbmFEbO8EFARh8Fsowu8muGZSZyzME85LDUAhFH1g 1Ny/1P7TaRWbcH8d51DnjZGX0lbY2mdayEjPC7ppSoasLkXLU8UVgWAqj4L/aU5VgD t08KKHnuaBGwvhVpODpY/eAU6Wb3MRCSnvsQ0iDg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mahesh Bandewar , Jay Vosburgh , Jakub Kicinski , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 33/57] bonding: fix active-backup transition after link failure Date: Fri, 27 Dec 2019 13:01:58 -0500 Message-Id: <20191227180222.7076-33-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191227180222.7076-1-sashal@kernel.org> References: <20191227180222.7076-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Mahesh Bandewar [ Upstream commit 5d485ed88d48f8101a2067348e267c0aaf4ed486 ] After the recent fix in commit 1899bb325149 ("bonding: fix state transition issue in link monitoring"), the active-backup mode with miimon initially come-up fine but after a link-failure, both members transition into backup state. Following steps to reproduce the scenario (eth1 and eth2 are the slaves of the bond): ip link set eth1 up ip link set eth2 down sleep 1 ip link set eth2 up ip link set eth1 down cat /sys/class/net/eth1/bonding_slave/state cat /sys/class/net/eth2/bonding_slave/state Fixes: 1899bb325149 ("bonding: fix state transition issue in link monitoring") CC: Jay Vosburgh Signed-off-by: Mahesh Bandewar Acked-by: Jay Vosburgh Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/bonding/bond_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 5f6602cb191f..fef599eb822b 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2186,9 +2186,6 @@ static void bond_miimon_commit(struct bonding *bond) } else if (BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) { /* make it immediately active */ bond_set_active_slave(slave); - } else if (slave != primary) { - /* prevent it from being the active one */ - bond_set_backup_slave(slave); } netdev_info(bond->dev, "link status definitely up for interface %s, %u Mbps %s duplex\n", -- 2.20.1