Skip to contentSkip to conversation

rgmanager: Exit uncleanly only when CMAN_SHUTDOWN_ANYWAY is set

PATCH New Ryan McCabe 2 participants 2 messages Jul 27, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rgmanager: Exit uncleanly only when CMAN_SHUTDOWN_ANYWAY is set

Only exit uncleanly when the CMAN_SHUTDOWN_ANYWAY flag is set in the argument passed when handling the CMAN_REASON_TRY_SHUTDOWN event.

This fixes the case where args is 2, where we want to refuse to shut down.

Resolves: rhbz#769730

---
 rgmanager/src/clulib/msg_cluster.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
rgmanager/src/clulib/msg_cluster.c +4 -2
index e864853..e4b6b39 100644
@@ -211,7 +211,7 @@ poll_cluster_messages(int timeout)
 
 		if (cman_dispatch(ch, 0) < 0) {
 			process_cman_event(ch, NULL,
-					   CMAN_REASON_TRY_SHUTDOWN, 1);
+			   CMAN_REASON_TRY_SHUTDOWN, CMAN_SHUTDOWN_ANYWAY);
 		}
 		ret = 0;
 	}
@@ -987,7 +987,9 @@ process_cman_event(cman_handle_t handle, void *private, int reason, int arg)
 	printf("EVENT: %p %p %d %d\n", handle, private, reason, arg);
 #endif
 
-	if (reason == CMAN_REASON_TRY_SHUTDOWN && !arg) {
+	if (reason == CMAN_REASON_TRY_SHUTDOWN &&
+	    !(arg & CMAN_SHUTDOWN_ANYWAY))
+	{
 		cman_replyto_shutdown(handle, 0);
 		return;
 	}
Signature · 1 line
1.7.11.2
#1 lore raw

PATCH 1/1 rgmanager: Exit uncleanly only when CMAN_SHUTDOWN_ANYWAY is set

ACK

we will need an upstream/rhel6 equivalent too for this one. See my comment in BZ.

Fabio

Quoted 38 lines · Ryan McCabe

Only exit uncleanly when the CMAN_SHUTDOWN_ANYWAY flag is set in the argument passed when handling the CMAN_REASON_TRY_SHUTDOWN event.

This fixes the case where args is 2, where we want to refuse to shut down.

Resolves: rhbz#769730

---
 rgmanager/src/clulib/msg_cluster.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
rgmanager/src/clulib/msg_cluster.c +4 -2
index e864853..e4b6b39 100644
@@ -211,7 +211,7 @@ poll_cluster_messages(int timeout)
 
 		if (cman_dispatch(ch, 0) < 0) {
 			process_cman_event(ch, NULL,
-					   CMAN_REASON_TRY_SHUTDOWN, 1);
+			   CMAN_REASON_TRY_SHUTDOWN, CMAN_SHUTDOWN_ANYWAY);
 		}
 		ret = 0;
 	}
@@ -987,7 +987,9 @@ process_cman_event(cman_handle_t handle, void *private, int reason, int arg)
 	printf("EVENT: %p %p %d %d\n", handle, private, reason, arg);
 #endif
 
-	if (reason == CMAN_REASON_TRY_SHUTDOWN && !arg) {
+	if (reason == CMAN_REASON_TRY_SHUTDOWN &&
+	    !(arg & CMAN_SHUTDOWN_ANYWAY))
+	{
 		cman_replyto_shutdown(handle, 0);
 		return;
 	}