gfs2-utils: master - gfs_controld: wait for dlm registration

David Teigland teigland@fedoraproject.org
Tue Mar 10 20:57:00 GMT 2009


Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=4d9ddb037da27f04ba0dd7760e11f84b81c190eb
Commit:        4d9ddb037da27f04ba0dd7760e11f84b81c190eb
Parent:        ec9ec0451669c081bde50ad41280b94aa2e0c11b
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Tue Mar 10 15:30:40 2009 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Tue Mar 10 15:53:30 2009 -0500

gfs_controld: wait for dlm registration

The dlm registration result generally comes back right away, but to cover
all cases we need to record that it happens and wait to mount until it's
complete.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 group/gfs_controld/cpg-new.c    |   15 +++++++++++++--
 group/gfs_controld/gfs_daemon.h |    1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/group/gfs_controld/cpg-new.c b/group/gfs_controld/cpg-new.c
index ed02931..f15e3e5 100644
--- a/group/gfs_controld/cpg-new.c
+++ b/group/gfs_controld/cpg-new.c
@@ -680,8 +680,14 @@ void process_dlmcontrol(int ci)
 		node->dlm_notify_result = result;
 
 	} else if (type == DLMC_RESULT_REGISTER) {
-		log_group(mg, "process_dlmcontrol register nodeid %d result %d",
-			  nodeid, result);
+		if (result) {
+			/* shouldn't happen */
+			log_error("process_dlmcontrol register %d", result);
+		} else
+			log_group(mg, "process_dlmcontrol register %d", result);
+
+		mg->dlm_registered = 1;
+
 	} else {
 		log_group(mg, "process_dlmcontrol unknown type %d", type);
 	}
@@ -752,6 +758,11 @@ static int check_dlm_notify_done(struct mountgroup *mg)
 
 static int wait_conditions_done(struct mountgroup *mg)
 {
+	if (!mg->dlm_registered) {
+		log_group(mg, "wait_conditions need dlm register");
+		return 0;
+	}
+
 	if (mg->first_recovery_needed) {
 		log_group(mg, "wait_conditions skip for first_recovery_needed");
 		return 1;
diff --git a/group/gfs_controld/gfs_daemon.h b/group/gfs_controld/gfs_daemon.h
index 913325c..08f42c3 100644
--- a/group/gfs_controld/gfs_daemon.h
+++ b/group/gfs_controld/gfs_daemon.h
@@ -143,6 +143,7 @@ struct mountgroup {
 	struct list_head        changes;
 	struct list_head        node_history;
 	struct list_head	journals;
+	int			dlm_registered;
 	int			dlm_notify_nodeid;
 	int			first_done_uevent;
 	int			first_recovery_needed;



More information about the Cluster-cvs mailing list