cluster: RHEL510 - rgmanager: Fix improper use of xmlCleanupParser()
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=6dbd73bff5c...
Commit: 6dbd73bff5c609a9b7aa57c8b15c7194554355df
Parent: 6d807b2d391332fbe401735603d6193a65a7aa3f
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Mon Jun 17 09:34:25 2013 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Wed Jun 19 21:34:19 2013 -0400
rgmanager: Fix improper use of xmlCleanupParser()
The libxml docs state that calling xmlCleanupParser() more than once
could result in memory corruption. I haven't been able to reproduce
memory corruption when calling from only one thread, but this function
does get called improperly any time the configuration is modified
after startup.
Related: rhbz#968322
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/daemons/main.c | 5 ++++-
rgmanager/src/daemons/resrules.c | 2 --
rgmanager/src/daemons/rg_locks.c | 4 +---
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/rgmanager/src/daemons/main.c b/rgmanager/src/daemons/main.c
index 59150c3..e5ba584 100644
--- a/rgmanager/src/daemons/main.c
+++ b/rgmanager/src/daemons/main.c
@@ -24,6 +24,7 @@
#include <errno.h>
#include <string.h>
#include <unistd.h>
+#include <libxml/parser.h>
#include <rg_locks.h>
#include <fcntl.h>
#include <resgroup.h>
@@ -1129,6 +1130,8 @@ main(int argc, char **argv)
return -1;
}
+ xmlInitParser();
+
memset(&me, 0, sizeof(me));
cman_get_node(clu, CMAN_NODEID_US, &me);
@@ -1218,7 +1221,7 @@ main(int argc, char **argv)
if (rg_initialized())
cleanup(cluster_ctx);
-
+ xmlCleanupParser();
out_cleanup:
/* XXX - This hangs if CMAN has died, so we skip if we are
* exiting uncleanly. */
diff --git a/rgmanager/src/daemons/resrules.c b/rgmanager/src/daemons/resrules.c
index 97a09a1..9d700c4 100644
--- a/rgmanager/src/daemons/resrules.c
+++ b/rgmanager/src/daemons/resrules.c
@@ -1131,7 +1131,6 @@ load_resource_rules(const char *rpath, resource_rule_t **rules)
if (!dir)
return -1;
- xmlInitParser();
while ((de = readdir(dir))) {
fn = basename(de->d_name);
@@ -1173,7 +1172,6 @@ load_resource_rules(const char *rpath, resource_rule_t **rules)
load_resource_rulefile(path, rules);
}
}
- xmlCleanupParser();
closedir(dir);
diff --git a/rgmanager/src/daemons/rg_locks.c b/rgmanager/src/daemons/rg_locks.c
index ce81711..2222fd2 100644
--- a/rgmanager/src/daemons/rg_locks.c
+++ b/rgmanager/src/daemons/rg_locks.c
@@ -129,9 +129,7 @@ ccs_lock(void)
#else /* No ccs support */
{
pthread_mutex_lock(&_ccs_mutex);
- xmlInitParser();
- ccs_doc = xmlParseFile(conffile);
- xmlCleanupParser();
+ ccs_doc = xmlParseFile(conffile);
if (!ccs_doc)
return -1;
return 0;
10 years, 9 months
gfs2-utils: master - gfs2_edit: fix a segfault with file names > 255 bytes
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=38730885...
Commit: 387308852e075432b77cf04217d3a47c3f6e07ca
Parent: 6f36886e36c1b0b3afe01bd6fe8cf49545eb6e43
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri Feb 1 21:28:46 2013 -0700
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Mon Jul 22 08:32:38 2013 -0500
gfs2_edit: fix a segfault with file names > 255 bytes
This patch fixes a segfault in gfs2_edit caused by trying to print
file names longer than 255 bytes.
---
gfs2/edit/gfs2hex.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index 6979cd9..cc0ceb6 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -122,7 +122,7 @@ void eol(int col) /* end of line */
void __attribute__((format (printf, 1, 2))) print_gfs2(const char *fmt, ...)
{
va_list args;
- char string[NAME_MAX];
+ char string[PATH_MAX];
memset(string, 0, sizeof(string));
va_start(args, fmt);
10 years, 9 months
gfs2-utils: master - gfs2_edit: display pointer offsets for directory dinodes
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=6f36886e...
Commit: 6f36886e36c1b0b3afe01bd6fe8cf49545eb6e43
Parent: f588517053536f538793aeb159ce26140a41954a
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri Feb 1 14:54:34 2013 -0700
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Mon Jul 22 08:32:38 2013 -0500
gfs2_edit: display pointer offsets for directory dinodes
This patch prints "pointer X" on the hex display for directory
dinodes like it does for indirect blocks.
---
gfs2/edit/hexedit.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index d67389e..f0d9789 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -954,7 +954,8 @@ static int hexdump(uint64_t startaddr, int len)
if (cursor_line) {
if (block_type == GFS2_METATYPE_IN ||
((block_type == GFS2_METATYPE_DI) &&
- ((struct gfs2_dinode*)bh->b_data)->di_height)) {
+ ((struct gfs2_dinode*)bh->b_data)->di_height) ||
+ S_ISDIR(di.di_mode)) {
int ptroffset = edit_row[dmode] * 16 +
edit_col[dmode];
10 years, 9 months
gfs2-utils: master - gfs2_edit: Add new option to print all bitmaps for an rgrp
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=f5885170...
Commit: f588517053536f538793aeb159ce26140a41954a
Parent: 49361e27628cf26554c1f690440dfca021713658
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Jan 28 10:31:09 2013 -0700
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Mon Jul 22 08:32:37 2013 -0500
gfs2_edit: Add new option to print all bitmaps for an rgrp
This patch adds a new keyword 'rgbitmaps' that causes gfs2_edit to
print all bitmaps for the given resource group. This is handy for
analysis of file system fragmentation.
---
gfs2/edit/hexedit.c | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 281be5a..d67389e 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2809,7 +2809,7 @@ static void dump_journal(const char *journal)
/* ------------------------------------------------------------------------ */
static void usage(void)
{
- fprintf(stderr,"\nFormat is: gfs2_edit [-c 1] [-V] [-x] [-h] [identify] [-z <0-9>] [-p structures|blocks][blocktype][blockalloc [val]][blockbits][blockrg][find sb|rg|rb|di|in|lf|jd|lh|ld|ea|ed|lb|13|qc][field <f>[val]] /dev/device\n\n");
+ fprintf(stderr,"\nFormat is: gfs2_edit [-c 1] [-V] [-x] [-h] [identify] [-z <0-9>] [-p structures|blocks][blocktype][blockalloc [val]][blockbits][blockrg][rgcount][rgflags][rgbitmaps][find sb|rg|rb|di|in|lf|jd|lh|ld|ea|ed|lb|13|qc][field <f>[val]] /dev/device\n\n");
fprintf(stderr,"If only the device is specified, it enters into hexedit mode.\n");
fprintf(stderr,"identify - prints out only the block type, not the details.\n");
fprintf(stderr,"printsavedmeta - prints out the saved metadata blocks from a savemeta file.\n");
@@ -2820,6 +2820,8 @@ static void usage(void)
fprintf(stderr,"restoremeta - restore metadata for debugging (DANGEROUS).\n");
fprintf(stderr,"rgcount - print how many RGs in the file system.\n");
fprintf(stderr,"rgflags rgnum [new flags] - print or modify flags for rg #rgnum (0 - X)\n");
+ fprintf(stderr,"rgbitmaps <rgnum> - print out the bitmaps for rgrp "
+ "rgnum.\n");
fprintf(stderr,"-V prints version number.\n");
fprintf(stderr,"-c 1 selects alternate color scheme 1\n");
fprintf(stderr,"-d prints details (for printing journals)\n");
@@ -3097,6 +3099,29 @@ static void process_parameters(int argc, char *argv[], int pass)
gfs2_rgrp_free(&sbd.rgtree);
exit(EXIT_SUCCESS);
}
+ } else if (!strcmp(argv[i], "rgbitmaps")) {
+ int rg, bmap;
+ uint64_t rgblk;
+ struct rgrp_tree *rgd;
+
+ i++;
+ if (i >= argc - 1) {
+ printf("Error: rg # not specified.\n");
+ printf("Format is: %s rgbitmaps rgnum\n",
+ argv[0]);
+ gfs2_rgrp_free(&sbd.rgtree);
+ exit(EXIT_FAILURE);
+ }
+ rg = atoi(argv[i]);
+ rgblk = get_rg_addr(rg);
+ rgd = gfs2_blk2rgrpd(&sbd, rgblk);
+ if (rgd == NULL) {
+ printf("Error: rg # is invalid.\n");
+ gfs2_rgrp_free(&sbd.rgtree);
+ exit(EXIT_FAILURE);
+ }
+ for (bmap = 0; bmap < rgd->ri.ri_length; bmap++)
+ push_block(rgblk + bmap);
}
else if (!strcasecmp(argv[i], "savemeta")) {
getgziplevel(argv, &i);
@@ -3177,7 +3202,8 @@ int main(int argc, char *argv[])
if (termlines)
interactive_mode();
else { /* print all the structures requested */
- for (i = 0; i <= blockhist; i++) {
+ i = 0;
+ while (blockhist > 0) {
block = blockstack[i + 1].block;
if (!block)
break;
@@ -3189,6 +3215,7 @@ int main(int argc, char *argv[])
eol(0);
}
block = pop_block();
+ i++;
}
}
close(fd);
10 years, 9 months
cluster: RHEL6 - cman: create and destroy lockfile on restart
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=2352c4bad21...
Commit: 2352c4bad21a4a470ad7f51a18c1d28afcb23455
Parent: 3e493a0883ef1fdc173ff25e48a3623cef7f2b0e
Author: John Ruemker <jruemker(a)redhat.com>
AuthorDate: Wed Mar 13 11:17:41 2013 -0400
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Jul 19 13:24:03 2013 +0100
cman: create and destroy lockfile on restart
The lockfile was ony created and destroyed only when
/etc/init.d/cman {stop, start} is called.
This patch adds lockfile create/destroy to the other functions
Resolves: rhbz#982670
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
cman/init.d/cman.in | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 384fa2f..7933478 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -834,6 +834,7 @@ start()
fence_join_enabled \
"Joining fence domain"
+ touch $LOCK_FILE
}
stop()
@@ -883,6 +884,8 @@ stop()
runwrap stop_configfs \
none \
"Unmounting configfs"
+
+ rm -f $LOCK_FILE
}
cmanstatus()
@@ -933,7 +936,7 @@ fi
# See how we were called.
case "$1" in
start)
- start "$2" && touch $LOCK_FILE
+ start "$2"
if [ "$INITLOGLEVEL" = "quiet" ]; then
success
echo
@@ -944,7 +947,7 @@ stop)
if [ -n "$2" ] && [ "$2" = "remove" ]; then
cmanremove=remove
fi
- stop && rm -f $LOCK_FILE
+ stop
if [ "$INITLOGLEVEL" = "quiet" ]; then
success
echo
10 years, 9 months
cluster: RHEL6 - qdiskd: Do not count missed updates from offline nodes
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=3e493a0883e...
Commit: 3e493a0883ef1fdc173ff25e48a3623cef7f2b0e
Parent: 18ddd5d171e09b73125f82930429eb383851a294
Author: John Ruemker <jruemker(a)redhat.com>
AuthorDate: Wed Mar 13 11:17:41 2013 -0400
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Jul 19 12:51:41 2013 +0100
qdiskd: Do not count missed updates from offline nodes
After qdiskd initialization, nodes that have not yet been online may
have missed updates counted, leading to eviction. This change skips
counting missed updates for nodes with state S_NONE.
Resolves: rhbz#920358
---
cman/qdisk/main.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index 46ccc39..49ea3da 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -196,12 +196,14 @@ read_node_blocks(qd_ctx *ctx, node_info_t *ni, int max)
/* Unchanged timestamp: miss */
if ((sb->ps_timestamp == ni[x].ni_last_seen) &&
(ni[x].ni_state != S_EXIT)) {
- /* XXX check for average + allow grace */
- ni[x].ni_misses++;
- if (ni[x].ni_misses > 1) {
- logt_print(LOG_DEBUG,
- "Node %d missed an update (%d/%d)\n",
- x+1, ni[x].ni_misses, ctx->qc_tko);
+ if (ni[x].ni_state != S_NONE) {
+ /* XXX check for average + allow grace */
+ ni[x].ni_misses++;
+ if (ni[x].ni_misses > 1) {
+ logt_print(LOG_DEBUG,
+ "Node %d missed an update (%d/%d)\n",
+ x+1, ni[x].ni_misses, ctx->qc_tko);
+ }
}
continue;
}
10 years, 9 months
cluster: RHEL6 - config: fix cluster.conf man page to reflect correct syslog_facility default
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=18ddd5d171e...
Commit: 18ddd5d171e09b73125f82930429eb383851a294
Parent: edd283ff46a06f774f2033b54eef853ae67caf07
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu Jan 17 08:53:29 2013 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Jul 19 12:48:16 2013 +0100
config: fix cluster.conf man page to reflect correct syslog_facility default
Resolves: rhbz#896191
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
config/man/cluster.conf.5 | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/man/cluster.conf.5 b/config/man/cluster.conf.5
index aa653be..ad2cfee 100644
--- a/config/man/cluster.conf.5
+++ b/config/man/cluster.conf.5
@@ -136,7 +136,7 @@ enable/disable messages to log file (yes/no), default "yes"
.TP 8
.B syslog_facility
-facility used for syslog messages, default "daemon"
+facility used for syslog messages, default "local4"
.TP 8
.B syslog_priority
@@ -158,7 +158,7 @@ a shortcut for logfile_priority="debug"
An explicit configuration for the default settings would be:
.P
.nf
-<logging to_syslog="yes" to_logfile="yes" syslog_facility="daemon"
+<logging to_syslog="yes" to_logfile="yes" syslog_facility="local4"
syslog_priority="info" logfile_priority="info">
<logging_daemon name="qdiskd"
logfile="/var/log/cluster/qdiskd.log"/>
10 years, 9 months
cluster: RHEL6 - fenced: Fix path to "two_node" in ccs
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=edd283ff46a...
Commit: edd283ff46a06f774f2033b54eef853ae67caf07
Parent: 629718d527681ad6c7fd2169f06a5524c1fd38cb
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Tue Feb 19 15:19:59 2013 +0000
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Jul 19 11:41:24 2013 +0100
fenced: Fix path to "two_node" in ccs
The path in the previous two_node patch was incorrect, it should have been:
Thanks to John Ruemker for spotting this
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
fence/fenced/config.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/fenced/config.c b/fence/fenced/config.c
index 651ea8b..1b9a3e0 100644
--- a/fence/fenced/config.c
+++ b/fence/fenced/config.c
@@ -95,7 +95,7 @@ void read_ccs_int(const char *path, int *config_val)
#define OVERRIDE_PATH_PATH "/cluster/fence_daemon/@override_path"
#define OVERRIDE_TIME_PATH "/cluster/fence_daemon/@override_time"
#define METHOD_NAME_PATH "/cluster/clusternodes/clusternode[@name=\"%s\"]/fence/method[%d]/@name"
-#define TWO_NODE_PATH "/cluster/cman/two_node"
+#define TWO_NODE_PATH "/cluster/cman/@two_node"
static int count_methods(char *victim)
{
10 years, 9 months
cluster: RHEL6 - qdiskd: change log level for an error message
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=629718d5276...
Commit: 629718d527681ad6c7fd2169f06a5524c1fd38cb
Parent: 8ed870ba01b471a0373ec5d09a5233200ec1ac55
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Dec 18 14:50:43 2012 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Jul 19 11:33:20 2013 +0100
qdiskd: change log level for an error message
Resolves: rhbz#888318
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/qdisk/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index 47ef5d2..46ccc39 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -1732,7 +1732,7 @@ get_static_config_data(qd_ctx *ctx, int ccsfd)
ctx->qc_token_timeout = atoi(val);
free(val);
if (ctx->qc_token_timeout < 10000) {
- logt_print(LOG_DEBUG, "Token timeout %d is too fast "
+ logt_print(LOG_ERR, "Token timeout %d is too fast "
"to use with qdiskd!\n",
ctx->qc_token_timeout);
return -1;
10 years, 9 months
cluster: RHEL6 - libccs: don't use uninitialized value in xpathlite
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=8ed870ba01b...
Commit: 8ed870ba01b471a0373ec5d09a5233200ec1ac55
Parent: 32d27530633334b6ca8a8d01a3f555043f6b13f9
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu Nov 8 13:36:44 2012 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Jul 19 11:30:35 2013 +0100
libccs: don't use uninitialized value in xpathlite
Resolves: rhbz#874538
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
config/libs/libccsconfdb/xpathlite.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/libs/libccsconfdb/xpathlite.c b/config/libs/libccsconfdb/xpathlite.c
index 0d770da..44bf346 100644
--- a/config/libs/libccsconfdb/xpathlite.c
+++ b/config/libs/libccsconfdb/xpathlite.c
@@ -290,10 +290,10 @@ static int get_data(confdb_handle_t handle, hdb_handle_t connection_handle,
value--;
}
- resval = malloc(datalen + keyvallen + 2);
+ resval = malloc(datalen + 2);
if (!resval)
goto fail;
- snprintf(resval, datalen + keyvallen + 2, "%s=%s", data, keyval);
+ snprintf(resval, datalen + 2, "%s=", data);
*rtn = resval;
} else if (!strncmp(curpos, "@*", strlen("@*"))) {
10 years, 9 months