From 4803b1ed2fcdeb876420c430a06f25a100fa0c1c Mon Sep 17 00:00:00 2001 From: Xin Long Date: Mon, 5 Dec 2022 16:41:04 -0500 Subject: [PATCH] 1.31-15 Resolves: rhbz#2148854 Signed-off-by: Xin Long --- ...-remove-the-ports-on-shutdown-with-N.patch | 46 +++++++++++++++++++ libteam.spec | 6 ++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 0008-teamd-do-no-remove-the-ports-on-shutdown-with-N.patch diff --git a/0008-teamd-do-no-remove-the-ports-on-shutdown-with-N.patch b/0008-teamd-do-no-remove-the-ports-on-shutdown-with-N.patch new file mode 100644 index 0000000..8bf65e7 --- /dev/null +++ b/0008-teamd-do-no-remove-the-ports-on-shutdown-with-N.patch @@ -0,0 +1,46 @@ +From dbb2cfca35d2cd15125eb84e8f3940f8cc3ea860 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Mon, 10 Oct 2022 18:33:53 +0200 +Subject: [PATCH] teamd: do no remove the ports on shutdown with -N + +With -N, teamd currently leaves the team device in place on shutdown, +as it's supposed to, but it removes all the ports. This severely limits +usefullness of the option, because it's still impossible to replace +the daemon with another one without disrupting connectivity. + +One use case where this is important is the handover from initrd to real +root, when a team device was used to provide connectivity to a network +root filesystem: + +Systemd's isolation of switch-root.target stops NetworkManager.service and +then terminates its kids, including teamd. The real NetworkManager.service +would eventually catch up and restart it, but there's a short period when +team ports are removed which is not great if we're booting off that device. +Also, it may be that ports come up in different order, causing team to get +a different MAC address, which will invalidate the DHCP lease we got +beforehands and screwing up L3 addressing. + +Let's not flush the ports when -N is used. + +Suggested-by: Jiri Pirko +Signed-off-by: Lubomir Rintel +Signed-off-by: Jiri Pirko +--- + teamd/teamd_per_port.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c +index d429753..9689df4 100644 +--- a/teamd/teamd_per_port.c ++++ b/teamd/teamd_per_port.c +@@ -217,7 +217,6 @@ static void port_obj_remove(struct teamd_context *ctx, + struct teamd_port *tdport = _port(port_obj); + + teamd_event_port_removed(ctx, tdport); +- teamd_port_remove(ctx, tdport); + port_obj_destroy(ctx, port_obj); + port_obj_free(port_obj); + } +-- +2.31.1 + diff --git a/libteam.spec b/libteam.spec index 548b7d8..93a8634 100644 --- a/libteam.spec +++ b/libteam.spec @@ -1,6 +1,6 @@ Name: libteam Version: 1.31 -Release: 14%{?dist} +Release: 15%{?dist} Summary: Library for controlling team network device License: LGPLv2+ URL: http://www.libteam.org @@ -13,6 +13,7 @@ Patch4: 0004-man-add-team2bond-man-doc.patch Patch5: 0005-Revert-teamd-Disregard-current-state-when-considerin.patch Patch6: 0006-utils-team2bond-do-not-add-miimon-if-already-exist.patch Patch7: 0007-utils-team2bond-do-not-add-updelay-downdelay-if-alre.patch +Patch8: 0008-teamd-do-no-remove-the-ports-on-shutdown-with-N.patch BuildRequires: gcc BuildRequires: jansson-devel @@ -145,6 +146,9 @@ install -p -m 755 utils/team2bond $RPM_BUILD_ROOT%{_bindir}/team2bond %{_sysconfdir}/sysconfig/network-scripts/ifdown-TeamPort %changelog +* Mon Dec 05 2022 Long Xin - 1.31-15 +- teamd: do no remove the ports on shutdown with -N (rhbz#2148854) + * Mon Jun 13 2022 Long Xin - 1.31-14 - Rebuilt with a new version to pass the fixed gating test (rhbz#2060445)