dlm: master - dlm_controld: fix fencing retries

David Teigland teigland at fedoraproject.org
Tue Jan 29 19:18:19 UTC 2013


Gitweb:        http://git.fedorahosted.org/git/?p=dlm.git;a=commitdiff;h=87007d98a6f20bc4b923aa87937818e765bfb0a4
Commit:        87007d98a6f20bc4b923aa87937818e765bfb0a4
Parent:        6a030a4efa08528c75ab5d045a3b3752a4b85fb2
Author:        David Teigland <teigland at redhat.com>
AuthorDate:    Tue Jan 29 13:15:27 2013 -0600
Committer:     David Teigland <teigland at redhat.com>
CommitterDate: Tue Jan 29 13:15:27 2013 -0600

dlm_controld: fix fencing retries

Fix the previous commit which caused fencing to
not be retried when daemon_fence_work was called
from anything bug process_fencing_changes.

Signed-off-by: David Teigland <teigland at redhat.com>
---
 dlm_controld/daemon_cpg.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/dlm_controld/daemon_cpg.c b/dlm_controld/daemon_cpg.c
index 0eec5ce..4002809 100644
--- a/dlm_controld/daemon_cpg.c
+++ b/dlm_controld/daemon_cpg.c
@@ -731,7 +731,7 @@ static void fence_pid_cancel(int nodeid, int pid)
  * later same as case B above
  */
 
-static int daemon_fence_work(void)
+static void daemon_fence_work(void)
 {
 	struct node_daemon *node, *safe;
 	int rv, nodeid, pid, need, low, actor, result;
@@ -742,13 +742,13 @@ static int daemon_fence_work(void)
 		/* We've seen a nodedown confchg callback, but not the
 		   corresponding ringid callback. */
 		log_retry(retry_fencing, "fence work wait for cpg ringid");
-		return retry;
+		goto out;
 	}
 
 	if (cluster_ringid_seq != daemon_ringid.seq) {
 		/* wait for ringids to be in sync */
 		log_retry(retry_fencing, "fence work wait for cluster ringid");
-		return retry;
+		goto out;
 	}
 
 	/* retry = 1; */
@@ -1105,21 +1105,22 @@ static int daemon_fence_work(void)
 	if (zombie_count)
 		clear_zombies();
 
-	return retry;
-}
-
-void process_fencing_changes(void)
-{
-	int retry;
-
-	retry = daemon_fence_work();
-
+	/*
+	 * setting retry_fencing will cause the main daemon poll loop
+	 * to timeout in 1 second and call this function again.
+	 */
+ out:
 	if (retry)
 		retry_fencing++;
 	else
 		retry_fencing = 0;
 }
 
+void process_fencing_changes(void)
+{
+	daemon_fence_work();
+}
+
 static void receive_fence_clear(struct dlm_header *hd, int len)
 {
 	struct fence_result *fr;


More information about the cluster-commits mailing list