cluster: STABLE3 - dlm_controld: cpg_finalize

David Teigland teigland@fedoraproject.org
Fri Feb 27 19:36:00 GMT 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=82a80f5d7a3d6da4dc4cb14b314546129c291c32
Commit:        82a80f5d7a3d6da4dc4cb14b314546129c291c32
Parent:        5e5e9381f9a10ecc3a5f62eabf9cb4baac6b11d4
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Fri Feb 27 13:33:19 2009 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Fri Feb 27 13:33:19 2009 -0600

dlm_controld: cpg_finalize

Call cpg_finalize on all our cpg handles when shutting down.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 group/dlm_controld/cpg.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 41a9677..1231ec9 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -2051,12 +2051,15 @@ int setup_cpg(void)
 
 void close_cpg(void)
 {
+	struct lockspace *ls;
 	cpg_error_t error;
 	struct cpg_name name;
 	int i = 0;
 
-	if (!daemon_cpg_handle || cluster_down)
+	if (!daemon_cpg_handle)
 		return;
+	if (cluster_down)
+		goto fin;
 
 	memset(&name, 0, sizeof(name));
 	sprintf(name.value, "dlm:controld");
@@ -2072,6 +2075,12 @@ void close_cpg(void)
 	}
 	if (error != CPG_OK)
 		log_error("daemon cpg_leave error %d", error);
+ fin:
+	list_for_each_entry(ls, &lockspaces, list) {
+		if (ls->cpg_handle)
+			cpg_finalize(ls->cpg_handle);
+	}
+	cpg_finalize(daemon_cpg_handle);
 }
 
 /* fs_controld has seen nodedown for nodeid; it's now ok for dlm to do



More information about the Cluster-cvs mailing list