The IPC patch broke CFG shutdown in several places, this patches fixes
all of them.

In particular, cfg_try_shutdown asks all applications that are
registered for callbacks if they approve the shutdown. This caused a bit
of a re-entrancy problem because it also asked the process that called
for the shutdown! The patch causes cfg to only ask OTHER applications in
the assumption that any application that calls
corosync_cfg_tryshutdown() will approve of the action :-)

In addition it adds the response to cfg_replyto_shutdown which was
missing (it couldn't be used with the old system but it mandatory now),
and removes a double-free in the library finalise code.

Chrissie
Index: include/corosync/coroipc.h
===================================================================
--- include/corosync/coroipc.h	(revision 1784)
+++ include/corosync/coroipc.h	(working copy)
@@ -91,6 +91,12 @@
 	void *ipc_context);
 
 cs_error_t
+cslib_msg_send (
+	void *ipc_context,
+	struct iovec *iov,
+	int iov_len);
+
+cs_error_t
 cslib_msg_send_reply_receive (
 	void *ipc_context,
 	struct iovec *iov,
Index: lib/coroipc.c
===================================================================
--- lib/coroipc.c	(revision 1784)
+++ lib/coroipc.c	(working copy)
@@ -544,7 +544,7 @@
 	return (1);
 }
 
-static cs_error_t
+cs_error_t
 cslib_msg_send (
 	void *ipc_context,
 	struct iovec *iov,
Index: lib/cfg.c
===================================================================
--- lib/cfg.c	(revision 1784)
+++ lib/cfg.c	(working copy)
@@ -765,7 +765,6 @@
 {
 	struct cfg_instance *cfg_instance;
 	struct req_lib_cfg_replytoshutdown req_lib_cfg_replytoshutdown;
-	struct res_lib_cfg_replytoshutdown res_lib_cfg_replytoshutdown;
 	struct iovec iov;
 	cs_error_t error;
 
@@ -782,16 +781,10 @@
 	iov.iov_base = &req_lib_cfg_replytoshutdown;
 	iov.iov_len = sizeof (struct req_lib_cfg_replytoshutdown);
 
-	pthread_mutex_lock (&cfg_instance->response_mutex);
-
-	error = cslib_msg_send_reply_receive (cfg_instance->ipc_ctx,
+	error = cslib_msg_send (cfg_instance->ipc_ctx,
 		&iov,
-		1,
-		&res_lib_cfg_replytoshutdown,
-		sizeof (struct res_lib_cfg_replytoshutdown));
+		1);
 
-	pthread_mutex_unlock (&cfg_instance->response_mutex);
-
 	return (error);
 }
 
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to