dlm: master - dlm_controld: fix log_plock
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=dlm.git;a=commitdiff;h=e7883bea402d425...
Commit: e7883bea402d425f176dc4176bf5123acc84e153
Parent: d1038d9e408fad4f6280b26b3f14366852a400ed
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Jun 7 14:36:46 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Jun 7 14:36:46 2012 -0500
dlm_controld: fix log_plock
log_plock messages were using a level of 0, which was meant
to indicate "none", but instead meant LOG_EMERG.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/dlm_daemon.h | 3 ++-
dlm_controld/logging.c | 12 ++++++------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
index aa31c82..7cb3c01 100644
--- a/dlm_controld/dlm_daemon.h
+++ b/dlm_controld/dlm_daemon.h
@@ -185,6 +185,7 @@ EXTERN struct fence_device fence_all_device;
#define LOG_DUMP_SIZE DLMC_DUMP_SIZE
#define LOG_PLOCK 0x00010000
+#define LOG_NONE 0x00001111
void log_level(char *name_in, uint32_t level_in, const char *fmt, ...);
@@ -192,7 +193,7 @@ void log_level(char *name_in, uint32_t level_in, const char *fmt, ...);
#define log_debug(fmt, args...) log_level(NULL, LOG_DEBUG, fmt, ##args)
#define log_group(ls, fmt, args...) log_level((ls)->name, LOG_DEBUG, fmt, ##args)
-#define log_plock(ls, fmt, args...) log_level((ls)->name, LOG_PLOCK, fmt, ##args)
+#define log_plock(ls, fmt, args...) log_level((ls)->name, LOG_PLOCK|LOG_NONE, fmt, ##args)
#define log_dlock(ls, fmt, args...) log_level((ls)->name, LOG_PLOCK|LOG_DEBUG, fmt, ##args)
#define log_elock(ls, fmt, args...) log_level((ls)->name, LOG_PLOCK|LOG_ERR, fmt, ##args)
diff --git a/dlm_controld/logging.c b/dlm_controld/logging.c
index d31249d..9347e43 100644
--- a/dlm_controld/logging.c
+++ b/dlm_controld/logging.c
@@ -88,8 +88,8 @@ void copy_log_dump_plock(char *buf, int *len)
log_copy(buf, len, log_dump_plock, &log_point_plock, &log_wrap_plock);
}
-static void log_save_str(int level, int len, char *log_buf,
- unsigned int *point, unsigned int *wrap)
+static void log_save_str(int len, char *log_buf, unsigned int *point,
+ unsigned int *wrap)
{
unsigned int p = *point;
unsigned int w = *wrap;
@@ -151,10 +151,10 @@ void log_level(char *name_in, uint32_t level_in, const char *fmt, ...)
log_str[pos++] = '\n';
log_str[pos++] = '\0';
- if (level)
- log_save_str(level, pos - 1, log_dump, &log_point, &log_wrap);
+ if (level < LOG_NONE)
+ log_save_str(pos - 1, log_dump, &log_point, &log_wrap);
if (plock)
- log_save_str(level, pos - 1, log_dump_plock, &log_point_plock, &log_wrap_plock);
+ log_save_str(pos - 1, log_dump_plock, &log_point_plock, &log_wrap_plock);
if (level <= syslog_priority)
syslog(level, "%s", log_str);
@@ -170,7 +170,7 @@ void log_level(char *name_in, uint32_t level_in, const char *fmt, ...)
if (!dlm_options[daemon_debug_ind].use_int)
return;
- if (level || (plock && opt(plock_debug_ind)))
+ if ((level < LOG_NONE) || (plock && opt(plock_debug_ind)))
fprintf(stderr, "%s", log_str);
}
11 years, 11 months
dlm: master - sysconfig: sample file
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=dlm.git;a=commitdiff;h=d1038d9e408fad4...
Commit: d1038d9e408fad4f6280b26b3f14366852a400ed
Parent: 88e1465323ef4689281df9282a21a407ceae59bf
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jun 6 11:32:03 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jun 6 11:32:03 2012 -0500
sysconfig: sample file
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
init/dlm.sysconfig | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/init/dlm.sysconfig b/init/dlm.sysconfig
new file mode 100644
index 0000000..1756bd8
--- /dev/null
+++ b/init/dlm.sysconfig
@@ -0,0 +1,2 @@
+# DLM_CONTROLD_OPTS -- set command line options for dlm_controld
+# See dlm_controld man page for list of options.
11 years, 11 months
cluster: STABLE32 - rgmanager: resrules: make expand_time buffer-less
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=9d0ecbac1ff...
Commit: 9d0ecbac1ff8ac1f045bd19bb73ca063a5351014
Parent: e187243a94a979ebc219d6f39134811b4c9471cb
Author: Jan Pokorný <jpokorny(a)redhat.com>
AuthorDate: Thu Apr 5 20:46:15 2012 +0200
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Wed Jun 6 09:25:39 2012 -0400
rgmanager: resrules: make expand_time buffer-less
This has several advantages:
- safe against unchecked (tainted; restart_expire, etc.) input
- detection of int type oveflow during conversion
- more flexibility when needed (e.g. when introducing more
strict rules)
Additionally, the int type overflow is checked before
any multiplying operation. All overflows leads to returning 0.
Test program for interactive tests of the function provided
(use "CFLAGS=-DNO_CCS make test-expand-time disable_dbus=1",
some dependencies needed due to high coupling :/)
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/include/reslist.h | 2 +-
rgmanager/src/daemons/Makefile | 13 +++++-
rgmanager/src/daemons/resrules.c | 74 +++++++++++++++++++-----------
rgmanager/src/daemons/test-expand-time.c | 25 ++++++++++
4 files changed, 85 insertions(+), 29 deletions(-)
diff --git a/rgmanager/include/reslist.h b/rgmanager/include/reslist.h
index e254ecc..93efeaa 100644
--- a/rgmanager/include/reslist.h
+++ b/rgmanager/include/reslist.h
@@ -136,7 +136,7 @@ int res_condstart(resource_node_t **tree, resource_t *res, void *ret);
int res_condstop(resource_node_t **tree, resource_t *res, void *ret);
int res_exec(resource_node_t *node, int op, const char *arg, int depth);
/*int res_resinfo(resource_node_t **tree, resource_t *res, void *ret);*/
-int expand_time(char *val);
+int expand_time(const char *val);
int store_action(resource_act_t **actsp, char *name, int depth, int timeout, int interval);
diff --git a/rgmanager/src/daemons/Makefile b/rgmanager/src/daemons/Makefile
index a178523..43d3377 100644
--- a/rgmanager/src/daemons/Makefile
+++ b/rgmanager/src/daemons/Makefile
@@ -3,6 +3,7 @@ TARGET2= rg_test
TARGET3= clurgmgrd
TARGET4= cpglockd
TARGET5= cpglockdump
+TARGET6= test-expand-time
SBINDIRT=$(TARGET1) $(TARGET2) $(TARGET4) $(TARGET5)
SBINSYMT=$(TARGET3)
@@ -47,6 +48,11 @@ OBJS4= cpglockd.o
OBJS5= cpglockdump.o
+OBJS6= test-expand-time.o \
+ reslist.o \
+ resrules.o \
+ rg_locks.o
+
CFLAGS += -DSHAREDIR=\"${sharedir}\" -D_GNU_SOURCE
CFLAGS += -fPIC
CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${corosyncincdir}
@@ -93,7 +99,7 @@ ${TARGET1}: ${OBJS1} ${LDDEPS}
#
# The data in the 'tests' directory is hand-crafted; so running 'gentests.sh'
# will require that the developer hand-verify the correctness of the
-# resulting output prior to committing back to CVS.
+# resulting output prior to committing back to VCS.
#
# This is NOT meant to be an installed binary. Rather, RPMs and/or other
# packages should run 'make check' as part of the build process.
@@ -112,6 +118,11 @@ ${TARGET4}: ${OBJS4} ${LDDEPS}
${TARGET5}: ${OBJS5} ${LDDEPS}
$(CC) -o $@ $^ $(CPG_LDFLAGS)
+# This is a test of a specific parsing function; after top-level "configure",
+# compile it locally as "CFLAGS=-DNO_CCS make test-expand-time disable_dbus=1".
+${TARGET6}: ${OBJS6}
+ $(CC) -o $@ $^ $(XML2_LDFLAGS)
+
check: rg_test
cd tests && ./runtests.sh
diff --git a/rgmanager/src/daemons/resrules.c b/rgmanager/src/daemons/resrules.c
index 104eb28..873488e 100644
--- a/rgmanager/src/daemons/resrules.c
+++ b/rgmanager/src/daemons/resrules.c
@@ -5,6 +5,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <limits.h>
#include <resgroup.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -213,65 +214,84 @@ _get_version(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base,
}
+/* Relying on compiler to cope with constants efficiently */
+#define TIMEF_M ( 60 * 1 )
+#define TIMEF_H ( 60 * TIMEF_M )
+#define TIMEF_D ( 24 * TIMEF_H )
+#define TIMEF_W ( 7 * TIMEF_D )
+#define TIMEF_Y ( 365 * TIMEF_D )
+
+/* NOTE: Only int type oveflows are checked (no targeted against time_t) */
int
-expand_time (char *val)
+expand_time (const char *val)
{
- int curval, len;
- int ret = 0;
- char *start = val, ival[16];
-
- if (!val)
- return (time_t)0;
+ int curval, tmp, ret = 0;
- while (start[0]) {
+ if (!val || *val == '\0')
+ return 0;
- len = 0;
+ do {
curval = 0;
- memset(ival, 0, sizeof(ival));
- while (isdigit(start[len])) {
- ival[len] = start[len];
- len++;
- }
+ while (isdigit(*val)) {
+ tmp = *val - '0';
- if (len) {
- curval = atoi(ival);
- } else {
- len = 1;
+ if (curval > INT_MAX/10
+ || (curval == INT_MAX/10 && tmp > INT_MAX%10))
+ /* Overflow */
+ break;
+
+ curval *= 10;
+ curval += tmp;
+ ++val;
}
- switch(start[len]) {
+ if (isdigit(*val))
+ /* Overflow detected */
+ return 0;
+
+ /* Watch for overflow also here */
+ switch(*val) {
case 0:
case 'S':
case 's':
break;
case 'M':
case 'm':
- curval *= 60;
+ if (curval > INT_MAX/TIMEF_M)
+ return 0;
+ curval *= TIMEF_M;
break;
case 'h':
case 'H':
- curval *= 3600;
+ if (curval > INT_MAX/TIMEF_H)
+ return 0;
+ curval *= TIMEF_H;
break;
case 'd':
case 'D':
- curval *= 86400;
+ if (curval > INT_MAX/TIMEF_D)
+ return 0;
+ curval *= TIMEF_D;
break;
case 'w':
case 'W':
- curval *= 604800;
+ if (curval > INT_MAX/TIMEF_W)
+ return 0;
+ curval *= TIMEF_W;
break;
case 'y':
case 'Y':
- curval *= 31536000;
+ if (curval > INT_MAX/TIMEF_Y)
+ return 0;
+ curval *= TIMEF_Y;
break;
default:
curval = 0;
}
+ ret += curval;
- ret += (time_t)curval;
- start += len;
- }
+ } while (*++val != '\0');
return ret;
}
diff --git a/rgmanager/src/daemons/test-expand-time.c b/rgmanager/src/daemons/test-expand-time.c
new file mode 100644
index 0000000..0a15452
--- /dev/null
+++ b/rgmanager/src/daemons/test-expand-time.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <time.h>
+
+/* XXX "list_head()", reslist.h should include on its own? */
+#include "list.h"
+/* XXX "restart_counter_t", dtto */
+#include "restart_counter.h"
+
+#include "reslist.h"
+
+int main(int argc, char *argv[])
+{
+ char buffer[255];
+ char *aux;
+ for (;;) {
+ printf("Time string: ");
+ if (!fgets(buffer, sizeof(buffer), stdin) && feof(stdin))
+ break;
+ aux = strchr(buffer,'\n');
+ if (aux)
+ *aux = '\0';
+ printf("Expanded : %d\n", expand_time(buffer));
+ }
+ return EXIT_SUCCESS;
+}
11 years, 11 months
fence-agents: master - build: fix dist_man_* vs man_*
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=723b70...
Commit: 723b70ae3f2930e26a7646a4eac881ae1f8e8f10
Parent: fec84e4f9232dccb6c2d5b027e23dd67972080a5
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Jun 4 15:43:15 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Jun 4 15:43:15 2012 +0200
build: fix dist_man_* vs man_*
those man pages should be generated at build time and not part
of the release tarball
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
fence/agents/baytech/Makefile.am | 2 +-
fence/agents/brocade/Makefile.am | 2 +-
fence/agents/bullpap/Makefile.am | 2 +-
fence/agents/cpint/Makefile.am | 2 +-
fence/agents/drac/Makefile.am | 2 +-
fence/agents/egenera/Makefile.am | 2 +-
fence/agents/ipmilan/Makefile.am | 2 +-
fence/agents/mcdata/Makefile.am | 2 +-
fence/agents/rackswitch/Makefile.am | 4 ++--
fence/agents/vixel/Makefile.am | 2 +-
fence/agents/xcat/Makefile.am | 2 +-
fence/agents/zvm/Makefile.am | 2 +-
12 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/fence/agents/baytech/Makefile.am b/fence/agents/baytech/Makefile.am
index 5288efa..c0b0b84 100644
--- a/fence/agents/baytech/Makefile.am
+++ b/fence/agents/baytech/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = $(SRC)
sbin_SCRIPTS = $(TARGET)
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fencemanperl.mk
diff --git a/fence/agents/brocade/Makefile.am b/fence/agents/brocade/Makefile.am
index ed3394d..3338804 100644
--- a/fence/agents/brocade/Makefile.am
+++ b/fence/agents/brocade/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = $(SRC)
sbin_SCRIPTS = $(TARGET)
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fencemanperl.mk
diff --git a/fence/agents/bullpap/Makefile.am b/fence/agents/bullpap/Makefile.am
index b454007..a602b5e 100644
--- a/fence/agents/bullpap/Makefile.am
+++ b/fence/agents/bullpap/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = $(SRC)
sbin_SCRIPTS = $(TARGET)
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fencemanperl.mk
diff --git a/fence/agents/cpint/Makefile.am b/fence/agents/cpint/Makefile.am
index e9fee26..c9680bd 100644
--- a/fence/agents/cpint/Makefile.am
+++ b/fence/agents/cpint/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = $(SRC)
sbin_SCRIPTS = $(TARGET)
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fencemanperl.mk
diff --git a/fence/agents/drac/Makefile.am b/fence/agents/drac/Makefile.am
index c9cdeda..392415f 100644
--- a/fence/agents/drac/Makefile.am
+++ b/fence/agents/drac/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = $(SRC)
sbin_SCRIPTS = $(TARGET)
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fencemanperl.mk
diff --git a/fence/agents/egenera/Makefile.am b/fence/agents/egenera/Makefile.am
index 6cd82a6..c69f805 100644
--- a/fence/agents/egenera/Makefile.am
+++ b/fence/agents/egenera/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = $(SRC)
sbin_SCRIPTS = $(TARGET)
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fencemanperl.mk
diff --git a/fence/agents/ipmilan/Makefile.am b/fence/agents/ipmilan/Makefile.am
index f237f92..17ac8f2 100644
--- a/fence/agents/ipmilan/Makefile.am
+++ b/fence/agents/ipmilan/Makefile.am
@@ -8,7 +8,7 @@ noinst_HEADERS = expect.h
fence_ipmilan_SOURCES = expect.c ipmilan.c
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencemanc.mk
diff --git a/fence/agents/mcdata/Makefile.am b/fence/agents/mcdata/Makefile.am
index f1a5939..54b64fc 100644
--- a/fence/agents/mcdata/Makefile.am
+++ b/fence/agents/mcdata/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = $(SRC)
sbin_SCRIPTS = $(TARGET)
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fencemanperl.mk
diff --git a/fence/agents/rackswitch/Makefile.am b/fence/agents/rackswitch/Makefile.am
index d2c9e1f..8c435c0 100644
--- a/fence/agents/rackswitch/Makefile.am
+++ b/fence/agents/rackswitch/Makefile.am
@@ -8,9 +8,9 @@ noinst_HEADERS = do_rack.h
fence_rackswitch_SOURCES = do_rack.c
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencemanc.mk
clean-local: clean-man
- rm -f $(TARGET)
\ No newline at end of file
+ rm -f $(TARGET)
diff --git a/fence/agents/vixel/Makefile.am b/fence/agents/vixel/Makefile.am
index 64d6010..3159e50 100644
--- a/fence/agents/vixel/Makefile.am
+++ b/fence/agents/vixel/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = $(SRC)
sbin_SCRIPTS = $(TARGET)
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fencemanperl.mk
diff --git a/fence/agents/xcat/Makefile.am b/fence/agents/xcat/Makefile.am
index 27c289c..ef99def 100644
--- a/fence/agents/xcat/Makefile.am
+++ b/fence/agents/xcat/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = $(SRC)
sbin_SCRIPTS = $(TARGET)
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fencemanperl.mk
diff --git a/fence/agents/zvm/Makefile.am b/fence/agents/zvm/Makefile.am
index 3ce3d82..2358d90 100644
--- a/fence/agents/zvm/Makefile.am
+++ b/fence/agents/zvm/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = $(SRC)
sbin_SCRIPTS = $(TARGET)
-dist_man_MANS = $(TARGET).8
+man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fencemanperl.mk
11 years, 11 months
cluster: the annotated tag cluster-3.1.92 has been created
by Madison Kelly
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=789233c0d3f...
Commit: 789233c0d3f0cb1dc1ba88484342ea7321adb32b
Parent: 0000000000000000000000000000000000000000
Author: Digimer <digimer(a)alteeve.ca>
AuthorDate: 2012-06-01 21:51 +0000
Committer: Digimer <digimer(a)alteeve.ca>
CommitterDate: 2012-06-01 21:51 +0000
annotated tag: cluster-3.1.92 has been created
at 789233c0d3f0cb1dc1ba88484342ea7321adb32b (tag)
tagging e187243a94a979ebc219d6f39134811b4c9471cb (commit)
replaces cluster-3.1.91
cluster-3.1.92 release
Jan Pokorný (1):
rgmanager: reslist: fix insufficient null-termination
11 years, 11 months
cluster: STABLE32 - rgmanager: reslist: fix insufficient null-termination
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: e187243a94a979ebc219d6f39134811b4c9471cb
Parent: c0afc6f3180dd61c9b212e2eb61cdc8d9c56af9f
Author: Jan Pokorný <jpokorny(a)redhat.com>
AuthorDate: Fri Jun 1 17:11:23 2012 +0200
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Fri Jun 1 11:23:52 2012 -0400
rgmanager: reslist: fix insufficient null-termination
Previously, garbage could be part of the copied data (my bad).
This version should be sane in this regard.
References:
commit (STABLE32):
http://git.fedorahosted.org/git/?p=cluster.git;a=commit;h=a14f392
https://www.redhat.com/archives/cluster-devel/2012-April/msg00019.html
Signed-off-by: Jan Pokorný <jpokorny(a)redhat.com>
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/daemons/reslist.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/daemons/reslist.c b/rgmanager/src/daemons/reslist.c
index 43430cd..3c05df7 100644
--- a/rgmanager/src/daemons/reslist.c
+++ b/rgmanager/src/daemons/reslist.c
@@ -111,7 +111,7 @@ _attr_value(resource_node_t *node, const char *attrname, const char *ptype)
len = sizeof(p_type) - 1;
memcpy(p_type, ra->ra_value, len);
- p_type[sizeof(p_type)-1] = '\0';
+ p_type[len] = '\0';
/* Skip the "%" and recurse */
return _attr_value(node->rn_parent, ++c, p_type);
11 years, 11 months
cluster: RHEL58 - rgmanager: add nfsdrestart option as last resource to umount fs/clustefs
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: a7d4a8aee323162e42239fa80ea9a4b56dcace49
Parent: 93eb663d6b4bfed821ea4f66f18396eadb522468
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu May 24 08:39:24 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Jun 1 12:51:03 2012 +0200
rgmanager: add nfsdrestart option as last resource to umount fs/clustefs
Resolves: rhbz#827390
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Acked-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/clusterfs.sh | 30 ++++++++++++++++++++++++++++++
rgmanager/src/resources/fs.sh | 29 +++++++++++++++++++++++++++++
2 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/clusterfs.sh b/rgmanager/src/resources/clusterfs.sh
index 6a837b1..89b30a2 100755
--- a/rgmanager/src/resources/clusterfs.sh
+++ b/rgmanager/src/resources/clusterfs.sh
@@ -168,6 +168,20 @@ meta_data()
<content type="boolean"/>
</parameter>
+ <parameter name="nfsrestart">
+ <longdesc lang="en">
+ If set and unmounting the file system fails, the node will
+ try to restart nfs daemon and nfs lockd to drop all filesystem
+ references. Use this option as last resource.
+ This option requires force_unmount to be set and it is not
+ compatible with nfsserver resource.
+ </longdesc>
+ <shortdesc lang="en">
+ Enable NFS daemon and lockd workaround
+ </shortdesc>
+ <content type="boolean"/>
+ </parameter>
+
</parameters>
<actions>
@@ -667,6 +681,7 @@ stopFilesystem() {
typeset -i max_tries=3 # how many times to try umount
typeset -i sleep_time=2 # time between each umount failure
typeset -i refs=0
+ typeset nfsdthreads
typeset done=""
typeset umount_failed=""
typeset force_umount=""
@@ -786,6 +801,21 @@ stop: Could not match $OCF_RESKEY_device with a real device"
if [ "$force_umount" ]; then
if [ $try -eq 1 ]; then
fuser -TERM -kvm "$mp"
+
+ if [ "$OCF_RESKEY_nfsrestart" = "yes" ] || \
+ [ "$OCF_RESKEY_nfsrestart" = "1" ]; then
+ if [ -f /proc/fs/nfsd/threads ]; then
+ ocf_log warning "Restarting nfsd/nfslock"
+ nfsdthreads="$(cat /proc/fs/nfsd/threads)"
+ service nfslock stop
+ echo 0 > /proc/fs/nfsd/threads
+ echo $nfsdthreads > /proc/fs/nfsd/threads
+ service nfslock start
+ else
+ ocf_log err "Unable to determin nfsd information. nfsd restart aborted"
+ fi
+ fi
+
else
fuser -kvm "$mp"
fi
diff --git a/rgmanager/src/resources/fs.sh b/rgmanager/src/resources/fs.sh
index 49912c2..5724352 100755
--- a/rgmanager/src/resources/fs.sh
+++ b/rgmanager/src/resources/fs.sh
@@ -202,6 +202,20 @@ meta_data()
<content type="boolean"/>
</parameter>
+ <parameter name="nfsrestart">
+ <longdesc lang="en">
+ If set and unmounting the file system fails, the node will
+ try to restart nfs daemon and nfs lockd to drop all filesystem
+ references. Use this option as last resource.
+ This option requires force_unmount to be set and it is not
+ compatible with nfsserver resource.
+ </longdesc>
+ <shortdesc lang="en">
+ Enable NFS daemon and lockd workaround
+ </shortdesc>
+ <content type="boolean"/>
+ </parameter>
+
<parameter name="fsid">
<longdesc lang="en">
File system ID for NFS exports. This can be overridden
@@ -1005,6 +1019,7 @@ stopFilesystem() {
typeset -i max_tries=3 # how many times to try umount
typeset -i sleep_time=5 # time between each umount failure
typeset -i nfslock_reclaim=0
+ typeset nfsdthreads
typeset done=""
typeset umount_failed=""
typeset force_umount=""
@@ -1108,6 +1123,20 @@ stop: Could not match $OCF_RESKEY_device with a real device"
notify_list_store $mp/.clumanager/statd
nfslock_reclaim=1
fi
+
+ if [ "$OCF_RESKEY_nfsrestart" = "yes" ] || \
+ [ "$OCF_RESKEY_nfsrestart" = "1" ]; then
+ if [ -f /proc/fs/nfsd/threads ]; then
+ ocf_log warning "Restarting nfsd/nfslock"
+ nfsdthreads="$(cat /proc/fs/nfsd/threads)"
+ service nfslock stop
+ echo 0 > /proc/fs/nfsd/threads
+ echo $nfsdthreads > /proc/fs/nfsd/threads
+ service nfslock start
+ else
+ ocf_log err "Unable to determin nfsd information. nfsd restart aborted"
+ fi
+ fi
else
fuser -kvm "$mp"
fi
11 years, 11 months
cluster: the annotated tag cluster-3.1.91 has been created
by Madison Kelly
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 8f34db0d3dae25c9733cdff1f5df1af404280f3a
Parent: 0000000000000000000000000000000000000000
Author: Digimer <digimer(a)alteeve.ca>
AuthorDate: 2012-06-01 03:12 +0000
Committer: Digimer <digimer(a)alteeve.ca>
CommitterDate: 2012-06-01 03:12 +0000
annotated tag: cluster-3.1.91 has been created
at 8f34db0d3dae25c9733cdff1f5df1af404280f3a (tag)
tagging c0afc6f3180dd61c9b212e2eb61cdc8d9c56af9f (commit)
replaces cluster-3.1.90
cluster-3.1.91 release
David Teigland (2):
fenced: fix handling of startup partition merge
dlm_controld: fix handling of startup partition merge
Fabio M. Di Nitto (25):
test commit
Revert "test commit"
test commit
Revert "test commit"
qdiskd: small tiny little cleanup
cman: fix bad merge from coverity branch
config: update relax ng schema to include totem miss_count_const
cman init: fix start sequence error handling
man: update fenced.8 to reflect a limitation in XML/DTD implementation
cpglockd: cleanup startup init scripts and drop code from rgmanager
cpglockd: fix pid file creation and check if daemon is already running
cpglockd: fix a startup race condition
rgmanager: cleanup binary linking and include dirs
cpglock: drop unused define
cpglockd: make network comm endian free
cpglockd: use standard logging infrastructure
cpglockd: refuse to shutdown if clients are connected
rgmanager: die hard if we cpglockd dies
cpglockd: show that we are alive while waiting for quorum (debug info)
rgmanager: fix cpglockd vs rgmanager startup race condition with systemd
rgmanager: fix conditional check for cpglockd startup
qdisk: Fix man page example (take 2)
cmannotifyd: deliver cluster status at startup and fix daemon init
cman init: allow sysconfig/cman to pass options to dlm_controld
cman init: add extra documentation for FENCE_JOIN=""
Jan Pokorný (6):
resrules: fix free while passing the pointer to caller
resrules: print_resource_rule doc comment conformance
rgmanager: resrules: simplify getting attributes + avoid memleaks
rgmanager: reslist: nothing avoids using size_t
rgmanager: reslist: sanitize act_dup
rgmanager: reslist: another string related cleanup
John Ruemker (1):
cman: Improve quorum timer handling how quorum timers work
Lon Hohberger (17):
rgmanager: OCF_NOT_INSTALLED is OK if we stop when stopped
rgmanager: Handle REASON_TRY_SHUTDOWN in two ways
rgmanager: Add extra service status call
rgmanager: Avoid duplicate restart of service
rgmanager: Fix call to service_status()
rgmanager: Fix tiny memory leak in sl_service_status
rgmanager: Fix dependency issue related to ordering
Revert "rgmanager: Fix dependency issue related to ordering"
rgmanager: Fix dependency issue related to ordering
config: Fix typo in schema
cman: Allocate port in cnxman-socket.h for qdiskd
rgmanager: Retry when config is out of sync
rgmanager: Add simple locking over CPG
rgmanager: Merge upstream cpglockd
rgmanager: Transmogrify states to expected values
rgmanager: Retry connection to cpglockd
rgmanager: Add man page for cpglockd; update rgmanager.8
Marc Grimme (1):
rgmanager: Small bug in follow-service.sl
Ryan McCabe (31):
rgmanager: Sync cpglock bits with upstream
rgmanager: Sync cpglock bits with upstream
rgmanager: Start cpglockd automatically when RRP mode is enabled
rgmanager: Add a utility to dump the cpglockd state
Allow -C to take a 1 or 0 argument to respectively force enable
Cleanup and exit if we receive a SIGTERM
Add a simple init script for cpglockd. The rgmanager init script still
Update Makefile for cpglockd init script
Cleanup the Makefile and add support to the cpglockd init script for
Clean up the pid file when exiting after running with -f
Avoid a free() of an uninitialized variable when central
Convert all remaining calls to printf and perror for error reporting
If we see a JOIN message from ourselves, move ourselves to the end of
Fix operation when quorum is lost:
Print cpg_mcast_joined() return value and errno if it fails
Add some additional debugging logging for try-locks
Set m.owner_nodeid to the our node id when NAKing requests when
Copy lock messages before swapping bytes because we
Work around a fenced hang/delay that can result in us unpausing too soon
Poll for fenced node updates less aggressively while waiting
Replace printf and fprintf calls with logt_print in the
Increment the recovered locks count when a client is disconnected.
rgmanager: Install the new cpglockd man page
Apply fixes from John Ruemker to fix some obscure error cases when
rgmanager: Fix the function prototypes for act_dup() which were broken
rgmanager: Clean up lock handling in groups.c
rgmanager: Fix return with lock held
rgmanager: Fix dependent service handling during recovery
cpglockd: Fix a hang triggered when fencing completes in less than 1s
rgmanager: Fix a crash when dbus notifications are enabled
rgmanager: Revert patch that caused a regression when operating on resources
jpokorny(a)redhat.com (1):
rgmanager: various cleanups regarding string functions
11 years, 11 months