Blame SOURCES/0024-rh1183444-enslave-team-fix.patch

ab7d06
From 04c4fb0a6ed719cfaa6b28c7daae51c0ccb549a2 Mon Sep 17 00:00:00 2001
ab7d06
From: Thomas Haller <thaller@redhat.com>
ab7d06
Date: Tue, 6 Oct 2015 10:40:45 +0200
ab7d06
Subject: [PATCH 1/3] device: fix activating master/slave devices during stage2
ab7d06
ab7d06
During stage2, if the slave detected that it would need to wait for
ab7d06
the master, it would return FALSE (which removes the g-idle-handler).
ab7d06
ab7d06
However, it would not clear the activation-source, so later, when
ab7d06
the master becomes ready, its attempt to schedule stage2 again would
ab7d06
result in an error-log and the idle-handler would not be scheduled
ab7d06
again.
ab7d06
ab7d06
Fixes: 85ac903bb8010409c4010ba09c621780b385b9b5
ab7d06
https://bugzilla.redhat.com/show_bug.cgi?id=1268797
ab7d06
https://bugzilla.redhat.com/show_bug.cgi?id=1183444
ab7d06
(cherry picked from commit c5210b322dd3d5d26d3a3adb6d2ca67a3fc387e0)
ab7d06
(cherry picked from commit 5c20dd9ea36a4bc84d1a32b0e30c8906570d5b02)
ab7d06
---
ab7d06
 src/devices/nm-device.c | 6 +++---
ab7d06
 1 file changed, 3 insertions(+), 3 deletions(-)
ab7d06
ab7d06
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
ab7d06
index 148bef4..7aa9bb5 100644
ab7d06
--- a/src/devices/nm-device.c
ab7d06
+++ b/src/devices/nm-device.c
ab7d06
@@ -2792,6 +2792,9 @@ nm_device_activate_stage2_device_config (gpointer user_data)
ab7d06
 	NMActiveConnection *active = NM_ACTIVE_CONNECTION (priv->act_request);
ab7d06
 	GSList *iter;
ab7d06
 
ab7d06
+	/* Clear the activation source ID now that this stage has run */
ab7d06
+	activation_source_clear (self, FALSE, 0);
ab7d06
+
ab7d06
 	if (!priv->master_ready_handled) {
ab7d06
 		if (!nm_active_connection_get_master (active))
ab7d06
 			priv->master_ready_handled = TRUE;
ab7d06
@@ -2814,9 +2817,6 @@ nm_device_activate_stage2_device_config (gpointer user_data)
ab7d06
 		}
ab7d06
 	}
ab7d06
 
ab7d06
-	/* Clear the activation source ID now that this stage has run */
ab7d06
-	activation_source_clear (self, FALSE, 0);
ab7d06
-
ab7d06
 	_LOGD (LOGD_DEVICE, "Activation: Stage 2 of 5 (Device Configure) starting...");
ab7d06
 	nm_device_state_changed (self, NM_DEVICE_STATE_CONFIG, NM_DEVICE_STATE_REASON_NONE);
ab7d06
 
ab7d06
-- 
ab7d06
2.4.3
ab7d06
ab7d06
ab7d06
From 3d8da19339a3fa5d5e7b66e821d0115ef18b7f17 Mon Sep 17 00:00:00 2001
ab7d06
From: Thomas Haller <thaller@redhat.com>
ab7d06
Date: Tue, 6 Oct 2015 12:03:51 +0200
ab7d06
Subject: [PATCH 2/3] device: handle master-ready before scheduling stage2
ab7d06
ab7d06
Don't handle master-ready at the beginning of stage2, but instead while
ab7d06
scheduling (and then possibly delaying the scheduling of stage2).
ab7d06
ab7d06
This seems more idiomatic:
ab7d06
ab7d06
  When inside a stage and your part is done: call schedule-next-stage.
ab7d06
  That is, always schedule the next stage, not the current one.
ab7d06
  schedule-next-stage then might delay to really scheduling until the
ab7d06
  device is ready for the next state.
ab7d06
ab7d06
Fixes: 85ac903bb8010409c4010ba09c621780b385b9b5
ab7d06
(cherry picked from commit 7bbc090387d6a1c519c92d957f5746faffb9325c)
ab7d06
(cherry picked from commit 7828003bf8bd21dd821ce448ebd18b8c55cc931d)
ab7d06
---
ab7d06
 src/devices/nm-device.c | 46 ++++++++++++++++++++++++----------------------
ab7d06
 1 file changed, 24 insertions(+), 22 deletions(-)
ab7d06
ab7d06
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
ab7d06
index 7aa9bb5..53a702d 100644
ab7d06
--- a/src/devices/nm-device.c
ab7d06
+++ b/src/devices/nm-device.c
ab7d06
@@ -2795,28 +2795,6 @@ nm_device_activate_stage2_device_config (gpointer user_data)
ab7d06
 	/* Clear the activation source ID now that this stage has run */
ab7d06
 	activation_source_clear (self, FALSE, 0);
ab7d06
 
ab7d06
-	if (!priv->master_ready_handled) {
ab7d06
-		if (!nm_active_connection_get_master (active))
ab7d06
-			priv->master_ready_handled = TRUE;
ab7d06
-		else {
ab7d06
-			/* If the master connection is ready for slaves, attach ourselves */
ab7d06
-			if (nm_active_connection_get_master_ready (active))
ab7d06
-				master_ready (self, active);
ab7d06
-			else {
ab7d06
-				_LOGD (LOGD_DEVICE, "waiting for master connection to become ready");
ab7d06
-
ab7d06
-				if (priv->master_ready_id == 0) {
ab7d06
-					priv->master_ready_id = g_signal_connect (active,
ab7d06
-					                                          "notify::" NM_ACTIVE_CONNECTION_INT_MASTER_READY,
ab7d06
-					                                          (GCallback) master_ready_cb,
ab7d06
-					                                          self);
ab7d06
-				}
ab7d06
-				/* Postpone */
ab7d06
-				return FALSE;
ab7d06
-			}
ab7d06
-		}
ab7d06
-	}
ab7d06
-
ab7d06
 	_LOGD (LOGD_DEVICE, "Activation: Stage 2 of 5 (Device Configure) starting...");
ab7d06
 	nm_device_state_changed (self, NM_DEVICE_STATE_CONFIG, NM_DEVICE_STATE_REASON_NONE);
ab7d06
 
ab7d06
@@ -2878,6 +2856,30 @@ nm_device_activate_schedule_stage2_device_config (NMDevice *self)
ab7d06
 	priv = NM_DEVICE_GET_PRIVATE (self);
ab7d06
 	g_return_if_fail (priv->act_request);
ab7d06
 
ab7d06
+	if (!priv->master_ready_handled) {
ab7d06
+		NMActiveConnection *active = NM_ACTIVE_CONNECTION (priv->act_request);
ab7d06
+
ab7d06
+		if (!nm_active_connection_get_master (active))
ab7d06
+			priv->master_ready_handled = TRUE;
ab7d06
+		else {
ab7d06
+			/* If the master connection is ready for slaves, attach ourselves */
ab7d06
+			if (nm_active_connection_get_master_ready (active))
ab7d06
+				master_ready (self, active);
ab7d06
+			else {
ab7d06
+				_LOGD (LOGD_DEVICE, "waiting for master connection to become ready");
ab7d06
+
ab7d06
+				if (priv->master_ready_id == 0) {
ab7d06
+					priv->master_ready_id = g_signal_connect (active,
ab7d06
+					                                          "notify::" NM_ACTIVE_CONNECTION_INT_MASTER_READY,
ab7d06
+					                                          (GCallback) master_ready_cb,
ab7d06
+					                                          self);
ab7d06
+				}
ab7d06
+				/* Postpone */
ab7d06
+				return;
ab7d06
+			}
ab7d06
+		}
ab7d06
+	}
ab7d06
+
ab7d06
 	activation_source_schedule (self, nm_device_activate_stage2_device_config, 0);
ab7d06
 
ab7d06
 	_LOGD (LOGD_DEVICE, "Activation: Stage 2 of 5 (Device Configure) scheduled...");
ab7d06
-- 
ab7d06
2.4.3
ab7d06
ab7d06
ab7d06
From bb73d0a828186ecd7af22fbb56a7faa88cbf71eb Mon Sep 17 00:00:00 2001
ab7d06
From: Thomas Haller <thaller@redhat.com>
ab7d06
Date: Tue, 6 Oct 2015 14:18:48 +0200
ab7d06
Subject: [PATCH 3/3] device: assert that master-ready handler is not scheduled
ab7d06
 in schedule_stage2_device_config()
ab7d06
ab7d06
(cherry picked from commit c41be469ab107ea2b4813bf28a1618572b78aa6a)
ab7d06
(cherry picked from commit 4e0882e9239bffd89fe84df74fb2f0663624fc17)
ab7d06
---
ab7d06
 src/devices/nm-device.c | 5 +++--
ab7d06
 1 file changed, 3 insertions(+), 2 deletions(-)
ab7d06
ab7d06
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
ab7d06
index 53a702d..d566b24 100644
ab7d06
--- a/src/devices/nm-device.c
ab7d06
+++ b/src/devices/nm-device.c
ab7d06
@@ -2859,9 +2859,10 @@ nm_device_activate_schedule_stage2_device_config (NMDevice *self)
ab7d06
 	if (!priv->master_ready_handled) {
ab7d06
 		NMActiveConnection *active = NM_ACTIVE_CONNECTION (priv->act_request);
ab7d06
 
ab7d06
-		if (!nm_active_connection_get_master (active))
ab7d06
+		if (!nm_active_connection_get_master (active)) {
ab7d06
+			g_warn_if_fail (!priv->master_ready_id);
ab7d06
 			priv->master_ready_handled = TRUE;
ab7d06
-		else {
ab7d06
+		} else {
ab7d06
 			/* If the master connection is ready for slaves, attach ourselves */
ab7d06
 			if (nm_active_connection_get_master_ready (active))
ab7d06
 				master_ready (self, active);
ab7d06
-- 
ab7d06
2.4.3
ab7d06