[Cluster-devel] cluster/cman-kernel/src cnxman.c

pcaulfield at sourceware.org pcaulfield at sourceware.org
Tue Feb 27 10:37:14 UTC 2007


CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	pcaulfield at sourceware.org	2007-02-27 10:37:14

Modified files:
	cman-kernel/src: cnxman.c 

Log message:
	Stop cman_tool from trying to restart us while we are shutting things down.
	bz#229797

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman-kernel/src/cnxman.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.42.2.27&r2=1.42.2.28

--- cluster/cman-kernel/src/Attic/cnxman.c	2007/01/19 10:23:14	1.42.2.27
+++ cluster/cman-kernel/src/Attic/cnxman.c	2007/02/27 10:37:14	1.42.2.28
@@ -162,6 +162,7 @@
 #define ACK_TIMEOUT   1
 #define RESEND_NEEDED 2
 #define TIDY_BARRIERS 3
+#define IN_SHUTDOWN   4
 
 /* A queue of messages waiting to be sent. If kcl_sendmsg is called outside of
  * process context then the messages get put in here */
@@ -417,6 +418,7 @@
 	}
 	P_COMMS("closing down\n");
 
+	set_bit(IN_SHUTDOWN, &mainloop_flags);
 	quit_threads = 1;	/* force other thread to die too */
 
 	/* Wait for membership thread to finish, that way any
@@ -440,6 +442,7 @@
 	kfree(iobuf);
 
 	complete(&cluster_thread_comp);
+	clear_bit(IN_SHUTDOWN, &mainloop_flags);
 	return 0;
 }
 
@@ -1033,6 +1036,10 @@
 	if (master_sock && protocol == CLPROTO_MASTER)
 		return -EBUSY;
 
+	/* We are shutting down - please be patient */
+	if (protocol == CLPROTO_MASTER && test_bit(IN_SHUTDOWN, &mainloop_flags))
+		return -EBUSY;
+
 	/* cnxman not running and a client was requested */
 	if (!atomic_read(&cnxman_running) && protocol != CLPROTO_MASTER)
 		return -ENETDOWN;




More information about the Cluster-devel mailing list