[PATCH] votequorum: change init/clean up to deal with exit races

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>

Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
---
 exec/votequorum.c |   25 ++++++-------------------
 1 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/exec/votequorum.c b/exec/votequorum.c
index 3932c84..30404a5 100644
--- a/exec/votequorum.c
+++ b/exec/votequorum.c
@@ -1743,25 +1743,6 @@ static int votequorum_exec_exit_fn (void)
 		ret = votequorum_exec_send_nodeinfo(us->node_id);
 	}
 
-	/*
-	 * clean up our internals
-	 */
-
-	/*
-	 * free the node list and qdevice
-	 */
-
-	list_init(&cluster_members_list);
-	qdevice = NULL;
-	us = NULL;
-	memset(cluster_nodes, 0, sizeof(cluster_nodes));
-
-	/*
-	 * clean the tracking list
-	 */
-
-	list_init(&trackers_list);
-
 	LEAVE();
 	return ret;
 }
@@ -1776,8 +1757,14 @@ static char *votequorum_exec_init_fn (struct corosync_api_v1 *api)
 
 	ENTER();
 
+	/*
+	 * make sure we start clean
+	 */
 	list_init(&cluster_members_list);
 	list_init(&trackers_list);
+	qdevice = NULL;
+	us = NULL;
+	memset(cluster_nodes, 0, sizeof(cluster_nodes));
 
 	/*
 	 * Allocate a cluster_node for qdevice
-- 
1.7.7.6

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux