cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: lhh@sourceware.org <lhh@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/cman/qdisk disk.h main.c
Date: 3 Oct 2006 18:06:42 -0000	[thread overview]
Message-ID: <20061003180642.16705.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	lhh at sourceware.org	2006-10-03 18:06:41

Modified files:
	cman/qdisk     : disk.h main.c 

Log message:
	Fix #208577

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/disk.h.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/main.c.diff?cvsroot=cluster&r1=1.3&r2=1.4

--- cluster/cman/qdisk/disk.h	2006/06/23 16:05:33	1.3
+++ cluster/cman/qdisk/disk.h	2006/10/03 18:06:40	1.4
@@ -66,6 +66,11 @@
 } disk_state_flag_t;
 
 
+typedef enum {
+	RF_REBOOT = 0x1		/* Reboot if we go from master->none */
+} run_flag_t;
+
+
 /* RHEL 2.1 / RHCS3 old magic numbers */
 #define HEADER_MAGIC_OLD	0x39119FCD	/* partition header */
 #define STATE_MAGIC_OLD		0xF1840DCE	/* Status block */
@@ -235,7 +240,7 @@
 	disk_node_state_t qc_disk_status;
 	disk_node_state_t qc_status;
 	int qc_master;		/* Master?! */
-	int qc_unused;
+	run_flag_t qc_flags;
 	cman_handle_t qc_ch;
 	char *qc_device;
 	char *qc_label;
--- cluster/cman/qdisk/main.c	2006/06/23 16:05:33	1.3
+++ cluster/cman/qdisk/main.c	2006/10/03 18:06:40	1.4
@@ -664,7 +664,7 @@
 
 		score_req = ctx->qc_scoremin;
 		if (score_req <= 0)
-			score_req = ((score_max + 1) / 2);
+			score_req = (score_max/2 + 1);
 
 		if (score < score_req) {
 			clear_bit(mask, (ctx->qc_my_id-1), sizeof(mask));
@@ -679,7 +679,8 @@
 				++msg.m_seq;
 				bid_pending = 0;
 				cman_poll_quorum_device(ctx->qc_ch, 0);
-				/* reboot??? */
+				if (ctx->qc_flags & RF_REBOOT)
+					reboot(RB_AUTOBOOT);
 			}
 		}  else {
 			set_bit(mask, (ctx->qc_my_id-1), sizeof(mask));
@@ -827,6 +828,7 @@
 	ctx->qc_interval = 1;
 	ctx->qc_tko = 10;
 	ctx->qc_scoremin = 0;
+	ctx->qc_flags = RF_REBOOT;
 
 	/* Get log log_facility */
 	snprintf(query, sizeof(query), "/cluster/quorumd/@log_facility");
@@ -901,6 +903,15 @@
 			ctx->qc_scoremin = 0;
 	}
 
+	/* Get reboot flag for when we transition -> offline */
+	/* default = on, so, 0 to turn off */
+	snprintf(query, sizeof(query), "/cluster/quorumd/@reboot");
+	if (ccs_get(ccsfd, query, &val) == 0) {
+		if (!atoi(val))
+			ctx->qc_flags &= ~RF_REBOOT;
+		free(val);
+	}
+
 	*cfh = configure_heuristics(ccsfd, h, maxh);
 
 	clulog(LOG_DEBUG,



             reply	other threads:[~2006-10-03 18:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-03 18:06 lhh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-10-05 20:30 [Cluster-devel] cluster/cman/qdisk disk.h main.c lhh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061003180642.16705.qmail@sourceware.org \
    --to=lhh@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).