cluster: master - cman: Fix cman_is_listening crash

Christine Caulfield chrissie@fedoraproject.org
Wed Jan 7 16:31:00 GMT 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=de07e84c99c262bb124250ef9cde3297ce51eacc
Commit:        de07e84c99c262bb124250ef9cde3297ce51eacc
Parent:        cbd3091cf83f417f8bcd38bda062d7ecb4cdf78c
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Wed Jan 7 16:30:09 2009 +0000
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Wed Jan 7 16:30:09 2009 +0000

cman: Fix cman_is_listening crash

Also add a nasty hack to get clvmd to start up,

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman/services/cman/lib/libcman.c   |    7 +++++++
 cman/services/cman/services/cman.c |    6 ++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/cman/services/cman/lib/libcman.c b/cman/services/cman/lib/libcman.c
index eab0b7b..dfbdb99 100644
--- a/cman/services/cman/lib/libcman.c
+++ b/cman/services/cman/lib/libcman.c
@@ -146,11 +146,18 @@ static int cmanquorum_check_and_start(struct cman_inst *cman_inst)
 static int refresh_node_list(struct cman_inst *cman_inst)
 {
 	int error;
+	cman_callback_t notify_callback;
+
 	if (cmanquorum_check_and_start(cman_inst))
 		return -1;
 
 	cmanquorum_trackstart(cman_inst->cmq_handle, CS_TRACK_CURRENT);
+
+	// TODO FIXME this is horrible & racy
+	notify_callback = cman_inst->notify_callback;
+	cman_inst->notify_callback = NULL;
 	error = cmanquorum_dispatch(cman_inst->cmq_handle, CS_DISPATCH_ONE);
+	cman_inst->notify_callback = notify_callback;
 	return error;
 }
 
diff --git a/cman/services/cman/services/cman.c b/cman/services/cman/services/cman.c
index 8083ace..2b0bd73 100644
--- a/cman/services/cman/services/cman.c
+++ b/cman/services/cman/services/cman.c
@@ -559,8 +559,10 @@ static void message_handler_req_lib_cman_is_listening (void *conn, void *msg)
 		cman_send_message(0,0, req_lib_cman_is_listening->nodeid, &reqmsg, 1);
 	}
 	else {
-		res_lib_cman_is_listening.status = get_port_bit(node, req_lib_cman_is_listening->port);
-		error = 0;
+		if (node) {
+			res_lib_cman_is_listening.status = get_port_bit(node, req_lib_cman_is_listening->port);
+			error = 0;
+		}
 	}
 
 	res_lib_cman_is_listening.header.size = sizeof(res_lib_cman_is_listening);



More information about the Cluster-cvs mailing list