Skip to contentSkip to conversation

Cluster Project branch, STABLE, updated. rgmanager_1_9_66-13-g703bdf8

Cluster-devel [email protected] 1 participant 1 message Apr 17, 2008

lore
Share & tools
lore
#0 lore raw

This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=703bdf832679cdcad3137017cd07640483bed767

The branch, STABLE has been updated

       via  703bdf832679cdcad3137017cd07640483bed767 (commit)
      from  5ee43bab4b9c3048e58eb5f1de61d57b1a28e045 (commit)

Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.

- Log ----------------------------------------------------------------- commit 703bdf832679cdcad3137017cd07640483bed767

Author: Lon Hohberger <[email protected]>
Date:   Thu Apr 17 10:28:27 2008 -0400

[cman] Allow disk devices with sector sizes != 512 bytes

Merged from RHEL4 branch.

-----------------------------------------------------------------------

Summary of changes:

 cman/qdisk/clulog.c    |    2 +-
 cman/qdisk/disk.c      |  191 +++++++++++++++++++++++++++---------------------
 cman/qdisk/disk.h      |   58 +++++++++-----
 cman/qdisk/disk_util.c |   20 +++---
 cman/qdisk/main.c      |   61 +++++++++++++--
 cman/qdisk/mkqdisk.c   |    2 +-
 cman/qdisk/proc.c      |   54 ++++++++++---
 cman/qdisk/score.c     |   19 +++++
 8 files changed, 269 insertions(+), 138 deletions(-)
cman/qdisk/clulog.c +1 -1
index 9ed0eef..6b998f1 100644
@@ -273,7 +273,7 @@ do_clulog(int        severity,
 		fprintf(stdout, "%s", printmsg);
 	}
 
-	syslog(severity, logmsg);
+	syslog(severity, "%s", logmsg);
 
 	pthread_mutex_unlock(&log_mutex);
 
cman/qdisk/disk.c +107 -84

474 lines not on this page · raw message

cman/qdisk/disk.h +37 -21

128 lines not on this page · raw message

cman/qdisk/disk_util.c +10 -10
index 80c211d..b36f8d7 100644
@@ -201,8 +201,9 @@ qd_write_status(qd_ctx *ctx, int nid, disk_node_state_t state,
 	if (get_time(&start, ctx->qc_flags&RF_UPTIME) < 0)
 		utime_ok = 0;
 	swab_status_block_t(&ps);
-	if (qdisk_write(ctx->qc_fd, qdisk_nodeid_offset(nid), &ps,
-			sizeof(ps)) < 0) {
+	if (qdisk_write(&ctx->qc_disk,
+			qdisk_nodeid_offset(nid, ctx->qc_disk.d_blksz),
+			&ps, sizeof(ps)) < 0) {
 		printf("Error writing node ID block %d\n", nid);
 		return -1;
 	}
@@ -223,12 +224,12 @@ qd_write_status(qd_ctx *ctx, int nid, disk_node_state_t state,
 
 
 int
-qd_print_status(status_block_t *ps)
+qd_print_status(target_info_t *disk, status_block_t *ps)
 {
 	int x;
 
 	printf("Data @ offset %d:\n",
-	       (int)qdisk_nodeid_offset(ps->ps_nodeid));
+	       (int)qdisk_nodeid_offset(ps->ps_nodeid, disk->d_blksz));
 	printf("status_block_t {\n");
 	printf("\t.ps_magic = %08x;\n", (int)ps->ps_magic);
 	printf("\t.ps_nodeid = %d;\n", (int)ps->ps_nodeid);
@@ -261,11 +262,11 @@ qd_print_status(status_block_t *ps)
 
 
 int
-qd_read_print_status(int fd, int nid)
+qd_read_print_status(target_info_t *disk, int nid)
 {
 	status_block_t ps;
 
-	if (fd < 0) {
+	if (!disk || disk->d_fd < 0) {
 		errno = EINVAL;
 		return -1;
 	}
@@ -275,13 +276,13 @@ qd_read_print_status(int fd, int nid)
 		return -1;
 	}
 
-	if (qdisk_read(fd, qdisk_nodeid_offset(nid), &ps,
+	if (qdisk_read(disk, qdisk_nodeid_offset(nid, disk->d_blksz), &ps,
 			sizeof(ps)) < 0) {
 		printf("Error reading node ID block %d\n", nid);
 		return -1;
 	}
 	swab_status_block_t(&ps);
-	qd_print_status(&ps);
+	qd_print_status(disk, &ps);
 
 	return 0;
 }
@@ -339,6 +340,5 @@ qd_destroy(qd_ctx *ctx)
 		free(ctx->qc_device);
 		ctx->qc_device = NULL;
 	}
-	close(ctx->qc_fd);
-	ctx->qc_fd = -1;
+	qdisk_close(&ctx->qc_disk);
 }
cman/qdisk/main.c +53 -8

126 lines not on this page · raw message

cman/qdisk/mkqdisk.c +1 -1
index 76fa26d..057193a 100644
@@ -39,7 +39,7 @@ main(int argc, char **argv)
 	char *newdev = NULL, *newlabel = NULL;
 	int rv;
 
-	printf("mkqdisk v0.5.1\n");
+	printf("mkqdisk v0.5.2\n");
 
 	while ((rv = getopt(argc, argv, "Lf:c:l:h")) != EOF) {
 		switch (rv) {
cman/qdisk/proc.c +41 -13

97 lines not on this page · raw message

cman/qdisk/score.c +19 -0
index d8d7a8f..3f508a2 100644
@@ -75,6 +75,24 @@ nullify(void)
 
 
 /**
+  Set all signal handlers to default for exec of a script.
+  ONLY do this after a fork().
+ */
+void
+restore_signals(void)
+{
+	sigset_t set;
+	int x;
+
+	for (x = 1; x < _NSIG; x++)
+		signal(x, SIG_DFL);
+
+	sigfillset(&set);
+	sigprocmask(SIG_UNBLOCK, &set, NULL);
+}
+
+
+/**
   Spin off a user-defined heuristic
  */
 static int
@@ -117,6 +135,7 @@ fork_heuristic(struct h_data *h)
 	 */
 	set_priority(SCHED_OTHER, -1);
 	munlockall();
+	restore_signals();
 
 	argv[0] = "/bin/sh";
 	argv[1] = "-c";

hooks/post-receive
--
Cluster Project