From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24B2F2F8BC3; Mon, 13 Apr 2026 16:22:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776097350; cv=none; b=VHVl+EvwPstZF3/mSPinUriQOGx+Nk55sC3T4fTycmvc+GlDrpr7ruFUyo1kAk38G2Cs/jVfrBOi6NfLsF2tPhtv2RAWp/Tj5I+jgC/Ia1RXHxtPFw0/IZlrbcxyijeepV9huMgSQDg7q9HG/45cUlKXOOw/ifhsaLEVVPTS5Q4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776097350; c=relaxed/simple; bh=7yKXfO2PhoHIo1ZI6BK3fc+q30Lp8M17ceBt27H0re4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QvB2vktSfUd/JsB9t45iZtI9/0BzFAnryzqOR/tRuDYn8/p1oAVgYgZvLX6ML5t61Eg26U/Ug4NvlpMEFhtY24NnAfZQ7eE92i19IvEHtv1uTxJ9pk7nFkUc3KdAezx+1gwFGf4BuqU4sSlv86KPrfJbaN6iTpiz9k0mBzIc2m8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qxLsPyk0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qxLsPyk0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD8B7C2BCB6; Mon, 13 Apr 2026 16:22:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776097350; bh=7yKXfO2PhoHIo1ZI6BK3fc+q30Lp8M17ceBt27H0re4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qxLsPyk0QTkMNc/y+Kv+29o3IscoDz06veED2LQvJUO5N8ShGSzw3EkBYPHxjOULs Ge0NIo1wXhewygrWPS3uXyXiotTPtWUcGkiPoHeZG9oA92gq0YnltPdYuBCWazK04U uCWLihXW3UvN5p/enMsQHulOo1OUG+S3/XE+Huj4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Hangbin Liu , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 103/570] bonding: handle BOND_LINK_FAIL, BOND_LINK_BACK as valid link states Date: Mon, 13 Apr 2026 17:53:54 +0200 Message-ID: <20260413155834.302042733@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155830.386096114@linuxfoundation.org> References: <20260413155830.386096114@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hangbin Liu [ Upstream commit 3348be7978f450ede0c308a4e8416ac716cf1015 ] Before the fixed commit, we check slave->new_link during commit state, which values are only BOND_LINK_{NOCHANGE, UP, DOWN}. After the commit, we start using slave->link_new_state, which state also could be BOND_LINK_{FAIL, BACK}. For example, when we set updelay/downdelay, after a failover, the slave->link_new_state could be set to BOND_LINK_{FAIL, BACK} in bond_miimon_inspect(). And later in bond_miimon_commit(), it will treat it as invalid and print an error, which would cause confusion for users. [ 106.440254] bond0: (slave veth2): link status down for interface, disabling it in 200 ms [ 106.440265] bond0: (slave veth2): invalid new link 1 on slave [ 106.648276] bond0: (slave veth2): link status definitely down, disabling slave [ 107.480271] bond0: (slave veth2): link status up, enabling it in 200 ms [ 107.480288] bond0: (slave veth2): invalid new link 3 on slave [ 107.688302] bond0: (slave veth2): link status definitely up, 10000 Mbps full duplex Let's handle BOND_LINK_{FAIL, BACK} as valid link states. Fixes: 1899bb325149 ("bonding: fix state transition issue in link monitoring") Signed-off-by: Hangbin Liu Link: https://patch.msgid.link/20260304-b4-bond_updelay-v1-2-f72eb2e454d0@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/bonding/bond_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 1323a619db4d2..5321d9dca698a 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2715,8 +2715,14 @@ static void bond_miimon_commit(struct bonding *bond) continue; + case BOND_LINK_FAIL: + case BOND_LINK_BACK: + slave_dbg(bond->dev, slave->dev, "link_new_state %d on slave\n", + slave->link_new_state); + continue; + default: - slave_err(bond->dev, slave->dev, "invalid new link %d on slave\n", + slave_err(bond->dev, slave->dev, "invalid link_new_state %d on slave\n", slave->link_new_state); bond_propose_link_state(slave, BOND_LINK_NOCHANGE); -- 2.51.0