Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-05-17 06:38:43 +0200
committerJiri Slaby <jslaby@suse.cz>2019-05-17 06:38:47 +0200
commit87bf16a59c6321cb5f55e03728557c794f33ca41 (patch)
treef3897d5b93c1cb07a7a54e5c10c0dec4f1375680
parent300aaca5902297efc8b2718b7d06810120a0d0bc (diff)
bonding: fix arp_validate toggling in active-backup mode
-rw-r--r--patches.kernel.org/5.1.3-014-bonding-fix-arp_validate-toggling-in-active-bac.patch84
-rw-r--r--series.conf1
2 files changed, 85 insertions, 0 deletions
diff --git a/patches.kernel.org/5.1.3-014-bonding-fix-arp_validate-toggling-in-active-bac.patch b/patches.kernel.org/5.1.3-014-bonding-fix-arp_validate-toggling-in-active-bac.patch
new file mode 100644
index 0000000000..a4689806d7
--- /dev/null
+++ b/patches.kernel.org/5.1.3-014-bonding-fix-arp_validate-toggling-in-active-bac.patch
@@ -0,0 +1,84 @@
+From: Jarod Wilson <jarod@redhat.com>
+Date: Fri, 10 May 2019 17:57:09 -0400
+Subject: [PATCH] bonding: fix arp_validate toggling in active-backup mode
+References: bnc#1012628
+Patch-mainline: 5.1.3
+Git-commit: a9b8a2b39ce65df45687cf9ef648885c2a99fe75
+
+[ Upstream commit a9b8a2b39ce65df45687cf9ef648885c2a99fe75 ]
+
+There's currently a problem with toggling arp_validate on and off with an
+active-backup bond. At the moment, you can start up a bond, like so:
+
+modprobe bonding mode=1 arp_interval=100 arp_validate=0 arp_ip_targets=192.168.1.1
+ip link set bond0 down
+echo "ens4f0" > /sys/class/net/bond0/bonding/slaves
+echo "ens4f1" > /sys/class/net/bond0/bonding/slaves
+ip link set bond0 up
+ip addr add 192.168.1.2/24 dev bond0
+
+Pings to 192.168.1.1 work just fine. Now turn on arp_validate:
+
+echo 1 > /sys/class/net/bond0/bonding/arp_validate
+
+Pings to 192.168.1.1 continue to work just fine. Now when you go to turn
+arp_validate off again, the link falls flat on it's face:
+
+echo 0 > /sys/class/net/bond0/bonding/arp_validate
+dmesg
+...
+[133191.911987] bond0: Setting arp_validate to none (0)
+[133194.257793] bond0: bond_should_notify_peers: slave ens4f0
+[133194.258031] bond0: link status definitely down for interface ens4f0, disabling it
+[133194.259000] bond0: making interface ens4f1 the new active one
+[133197.330130] bond0: link status definitely down for interface ens4f1, disabling it
+[133197.331191] bond0: now running without any active interface!
+
+The problem lies in bond_options.c, where passing in arp_validate=0
+results in bond->recv_probe getting set to NULL. This flies directly in
+the face of commit 3fe68df97c7f, which says we need to set recv_probe =
+bond_arp_recv, even if we're not using arp_validate. Said commit fixed
+this in bond_option_arp_interval_set, but missed that we can get to that
+same state in bond_option_arp_validate_set as well.
+
+One solution would be to universally set recv_probe = bond_arp_recv here
+as well, but I don't think bond_option_arp_validate_set has any business
+touching recv_probe at all, and that should be left to the arp_interval
+code, so we can just make things much tidier here.
+
+Fixes: 3fe68df97c7f ("bonding: always set recv_probe to bond_arp_rcv in arp monitor")
+CC: Jay Vosburgh <j.vosburgh@gmail.com>
+CC: Veaceslav Falico <vfalico@gmail.com>
+CC: Andy Gospodarek <andy@greyhouse.net>
+CC: "David S. Miller" <davem@davemloft.net>
+CC: netdev@vger.kernel.org
+Signed-off-by: Jarod Wilson <jarod@redhat.com>
+Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/net/bonding/bond_options.c | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
+index da1fc17295d9..b996967af8d9 100644
+--- a/drivers/net/bonding/bond_options.c
++++ b/drivers/net/bonding/bond_options.c
+@@ -1098,13 +1098,6 @@ static int bond_option_arp_validate_set(struct bonding *bond,
+ {
+ netdev_dbg(bond->dev, "Setting arp_validate to %s (%llu)\n",
+ newval->string, newval->value);
+-
+- if (bond->dev->flags & IFF_UP) {
+- if (!newval->value)
+- bond->recv_probe = NULL;
+- else if (bond->params.arp_interval)
+- bond->recv_probe = bond_arp_rcv;
+- }
+ bond->params.arp_validate = newval->value;
+
+ return 0;
+--
+2.21.0
+
diff --git a/series.conf b/series.conf
index 7a0f454a43..08be7e0211 100644
--- a/series.conf
+++ b/series.conf
@@ -99,6 +99,7 @@
patches.kernel.org/5.1.3-011-mwl8k-Fix-rate_idx-underflow.patch
patches.kernel.org/5.1.3-012-rtlwifi-rtl8723ae-Fix-missing-break-in-switch-s.patch
patches.kernel.org/5.1.3-013-Don-t-jump-to-compute_result-state-from-check_r.patch
+ patches.kernel.org/5.1.3-014-bonding-fix-arp_validate-toggling-in-active-bac.patch
########################################################
# Build fixes that apply to the vanilla kernel too.