[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180614132600.351187645@linuxfoundation.org>
Date: Thu, 14 Jun 2018 16:04:43 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Mahesh Bandewar <maheshb@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Nate Clark <nate@...orld.us>
Subject: [PATCH 4.9 02/30] bonding: correctly update link status during mii-commit phase
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mahesh Bandewar <maheshb@...gle.com>
commit b5bf0f5b16b9c316c34df9f31d4be8729eb86845 upstream.
bond_miimon_commit() marks the link UP after attempting to get the speed
and duplex settings for the link. There is a possibility that
bond_update_speed_duplex() could fail. This is another place where it
could result into an inconsistent bonding link state.
With this patch the link will be marked UP only if the speed and duplex
values retrieved have sane values and processed further.
Signed-off-by: Mahesh Bandewar <maheshb@...gle.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
Cc: Nate Clark <nate@...orld.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/net/bonding/bond_main.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2140,7 +2140,12 @@ static void bond_miimon_commit(struct bo
continue;
case BOND_LINK_UP:
- bond_update_speed_duplex(slave);
+ if (bond_update_speed_duplex(slave)) {
+ netdev_warn(bond->dev,
+ "failed to get link speed/duplex for %s\n",
+ slave->dev->name);
+ continue;
+ }
bond_set_slave_link_state(slave, BOND_LINK_UP,
BOND_SLAVE_NOTIFY_NOW);
slave->last_link_up = jiffies;
Powered by blists - more mailing lists