cluster: RHEL6 - qdiskd: Fix bad timer check
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 4fe4dbb1e1261b2cfa471840134f27043f683385
Parent: 6c97937613317137f34286656068b5ee33108198
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Mar 3 17:39:10 2011 -0500
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Mar 18 09:39:33 2011 +0100
qdiskd: Fix bad timer check
Resolves: rhbz#679274
Resolves: rhbz#688154
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
Tested-by: Masanari Iida <masanari_iida(a)hp.com>
Acked-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/qdisk/score.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cman/qdisk/score.c b/cman/qdisk/score.c
index 572464d..3ca531f 100644
--- a/cman/qdisk/score.c
+++ b/cman/qdisk/score.c
@@ -86,7 +86,8 @@ fork_heuristic(struct h_data *h, struct timespec *now)
}
if (now->tv_sec < h->nextrun.tv_sec ||
- now->tv_nsec < h->nextrun.tv_nsec)
+ ((now->tv_sec == h->nextrun.tv_sec) &&
+ (now->tv_nsec < h->nextrun.tv_nsec)))
return 0;
h->nextrun.tv_sec = now->tv_sec + h->interval;
13 years, 1 month
cluster: RHEL57 - gfs2_edit savemeta doesn't save all leaf blocks for large dirs
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 39a2ee8ab10b7d7117adb124a846da4a083b4af0
Parent: 517c34c060d30e7467e316e96f389ced0c703ef1
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed Mar 16 13:00:07 2011 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Mar 16 13:01:56 2011 -0500
gfs2_edit savemeta doesn't save all leaf blocks for large dirs
This patch changes the gfs2_edit "savemeta" option so that it
processes exhash directories the same way that fsck.gfs2 does,
namely, it does a read of the hash table and saves all the
leaf blocks from that. Before it was trying to traverse the
blocks, but that only works for medium-size exhash directories.
rhbz#679565
---
gfs2/edit/savemeta.c | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 7c28ae9..a724807 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -130,9 +130,8 @@ static int get_gfs_struct_info(struct gfs2_buffer_head *lbh, int *block_type,
inode = inode_get(&sbd, lbh);
else
inode = gfs_inode_get(&sbd, lbh);
- if (inode->i_di.di_flags & GFS2_DIF_EXHASH &&
- (S_ISDIR(inode->i_di.di_mode) ||
- (gfs1 && inode->i_di.__pad1 == GFS_FILE_DIR)))
+ if (S_ISDIR(inode->i_di.di_mode) ||
+ (gfs1 && inode->i_di.__pad1 == GFS_FILE_DIR))
*gstruct_len = sbd.bsize;
else if (!inode->i_di.di_height && !block_is_systemfile() &&
!S_ISDIR(inode->i_di.di_mode))
@@ -385,10 +384,21 @@ static void save_inode_data(int out_fd)
}
}
/* Process directory exhash inodes */
- if (S_ISDIR(inode->i_di.di_mode)) {
- if (inode->i_di.di_flags & GFS2_DIF_EXHASH) {
- save_indirect_blocks(out_fd, cur_list, metabh,
- height, 0);
+ if (S_ISDIR(inode->i_di.di_mode) &&
+ inode->i_di.di_flags & GFS2_DIF_EXHASH) {
+ uint64_t leaf_no, old_leaf = -1;
+ int li;
+
+ for (li = 0; li < (1 << inode->i_di.di_depth); li++) {
+ gfs2_get_leaf_nr(inode, li, &leaf_no);
+ if (leaf_no == old_leaf ||
+ gfs2_check_range(&sbd, leaf_no) != 0)
+ continue;
+ old_leaf = leaf_no;
+ mybh = bread(&sbd, leaf_no);
+ if (gfs2_check_meta(mybh, GFS2_METATYPE_LF) == 0)
+ save_block(sbd.device_fd, out_fd, leaf_no);
+ brelse(mybh);
}
}
if (inode->i_di.di_eattr) { /* if this inode has extended attributes */
13 years, 1 month
gfs2-utils: master - gfs2_edit savemeta was not saving some directory info
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: f6e1c345d7cce3d5ceedf2b19868b5d6a008ea2c
Parent: 4a727917ff403b6f386c992d1e071e3f1a795893
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed Mar 16 12:50:10 2011 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Mar 16 12:50:10 2011 -0500
gfs2_edit savemeta was not saving some directory info
This patch allows gfs2_edit savemeta to save directory information for
directories that halfway between stuffed and exhash. That is, directories
that have the hash table stored as data in the dinode, but still have
leaf blocks.
---
gfs2/edit/savemeta.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 844da8c..4d9f591 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -118,9 +118,8 @@ static int get_gfs_struct_info(struct gfs2_buffer_head *lbh, int *block_type,
inode = inode_get(&sbd, lbh);
else
inode = gfs_inode_get(&sbd, lbh);
- if (inode->i_di.di_flags & GFS2_DIF_EXHASH &&
- (S_ISDIR(inode->i_di.di_mode) ||
- (gfs1 && inode->i_di.__pad1 == GFS_FILE_DIR)))
+ if (S_ISDIR(inode->i_di.di_mode) ||
+ (gfs1 && inode->i_di.__pad1 == GFS_FILE_DIR))
*gstruct_len = sbd.bsize;
else if (!inode->i_di.di_height && !block_is_systemfile() &&
!S_ISDIR(inode->i_di.di_mode))
13 years, 1 month
cluster: STABLE31 - cman init: increse the default timeout waiting for quorum
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: e5dd95786c6850866f0ffa15fe9fe564cbd9f765
Parent: a47bc261ef58cb056077c448c06a7c518dd4191d
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Wed Mar 16 16:24:27 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed Mar 16 16:28:04 2011 +0100
cman init: increse the default timeout waiting for quorum
not all clusters can achieve quorum in 20 seconds. Bump to 45 by default.
Value is still tunable via sysconfig entry.
Resolves: rhbz#688201
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 2 +-
cman/init.d/cman.init.defaults.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 7d9c7d1..12f428f 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -84,7 +84,7 @@ fi
# startup quorum is needed by many other applications, so we may as
# well wait here. If CMAN_QUORUM_TIMEOUT is zero, quorum will
# be ignored.
-[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=20
+[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=45
# CMAN_SHUTDOWN_TIMEOUT -- amount of time to wait for cman to become a
# cluster member before calling cman_tool leave during shutdown.
diff --git a/cman/init.d/cman.init.defaults.in b/cman/init.d/cman.init.defaults.in
index 390e855..ac21c97 100644
--- a/cman/init.d/cman.init.defaults.in
+++ b/cman/init.d/cman.init.defaults.in
@@ -10,7 +10,7 @@
# startup quorum is needed by many other applications, so we may as
# well wait here. If CMAN_QUORUM_TIMEOUT is zero, quorum will
# be ignored.
-#CMAN_QUORUM_TIMEOUT=20
+#CMAN_QUORUM_TIMEOUT=45
# CMAN_SHUTDOWN_TIMEOUT -- amount of time to wait for cman to become a
# cluster member before calling cman_tool leave during shutdown.
13 years, 1 month
cluster: STABLE31 - qdiskd: Fix bad timer check
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: a47bc261ef58cb056077c448c06a7c518dd4191d
Parent: 0f5af364300d3ddb2de2428de2f169be917a3c15
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Mar 3 17:39:10 2011 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Wed Mar 16 11:11:27 2011 -0400
qdiskd: Fix bad timer check
Resolves: rhbz#679274
Resolves: rhbz#688154
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
Tested-by: Masanari Iida <masanari_iida(a)hp.com>
---
cman/qdisk/score.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cman/qdisk/score.c b/cman/qdisk/score.c
index 572464d..3ca531f 100644
--- a/cman/qdisk/score.c
+++ b/cman/qdisk/score.c
@@ -86,7 +86,8 @@ fork_heuristic(struct h_data *h, struct timespec *now)
}
if (now->tv_sec < h->nextrun.tv_sec ||
- now->tv_nsec < h->nextrun.tv_nsec)
+ ((now->tv_sec == h->nextrun.tv_sec) &&
+ (now->tv_nsec < h->nextrun.tv_nsec)))
return 0;
h->nextrun.tv_sec = now->tv_sec + h->interval;
13 years, 1 month
cluster: RHEL6 - fence_wti: Unable to parse output when splitted into several screens (2/2)
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 6c97937613317137f34286656068b5ee33108198
Parent: c62d62119906b6c272ff3cac169c287313afdb92
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Feb 21 20:55:30 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed Mar 16 15:26:50 2011 +0100
fence_wti: Unable to parse output when splitted into several screens (2/2)
Minor changes to previous patch. Power ON/OFF now works as expected
Resolves: rhbz#678522
---
fence/agents/wti/fence_wti.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index d05676b..8caa4c2 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -28,13 +28,12 @@ def get_power_status(conn, options):
conn.send("/S"+"\r\n")
if isinstance(options["-c"], list):
- re_all = options["-c"]
+ re_all = list(options["-c"])
else:
re_all = [options["-c"]]
re_next = re.compile("Enter: ", re.IGNORECASE)
re_all.append(re_next)
- conn.send("/S"+"\r\n")
result = conn.log_expect(options, re_all, int(options["-Y"]))
listing = conn.before
if result == (len(re_all) - 1):
13 years, 1 month
cluster: RHEL6 - fence_wti: Unable to parse output when splitted into several screens
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: c62d62119906b6c272ff3cac169c287313afdb92
Parent: 18104afc78b4e5e0fd32cf002c99e33a5a3b052b
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Feb 21 19:42:18 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed Mar 16 15:26:44 2011 +0100
fence_wti: Unable to parse output when splitted into several screens
Parsing of listing that consists of several screens added.
Resolves: rhbz#678522
---
fence/agents/wti/fence_wti.py | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index a71852a..d05676b 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -22,9 +22,26 @@ BUILD_DATE="March, 2008"
#END_VERSION_GENERATION
def get_power_status(conn, options):
- try:
+ listing = ""
+
+ try:
+ conn.send("/S"+"\r\n")
+
+ if isinstance(options["-c"], list):
+ re_all = options["-c"]
+ else:
+ re_all = [options["-c"]]
+ re_next = re.compile("Enter: ", re.IGNORECASE)
+ re_all.append(re_next)
+
conn.send("/S"+"\r\n")
- conn.log_expect(options, options["-c"], int(options["-Y"]))
+ result = conn.log_expect(options, re_all, int(options["-Y"]))
+ listing = conn.before
+ if result == (len(re_all) - 1):
+ conn.send("\r\n")
+ conn.log_expect(options, options["-c"], int(options["-Y"]))
+ listing += conn.before
+
except pexpect.EOF:
fail(EC_CONNECTION_LOST)
except pexpect.TIMEOUT:
@@ -32,8 +49,8 @@ def get_power_status(conn, options):
plug_section = 0
outlets = {}
- for line in conn.before.splitlines():
- if (plug_section == 2) and line.find("|") >= 0:
+ for line in listing.splitlines():
+ if (plug_section == 2) and line.find("|") >= 0 and line.startswith("PLUG") == False:
plug_line = [x.strip().lower() for x in line.split("|")]
if len(plug_line) < len(plug_header):
plug_section = -1
@@ -42,7 +59,8 @@ def get_power_status(conn, options):
return plug_line[status_index]
else:
## We already believe that first column contains plug number
- outlets[plug_line[0]] = (plug_line[name_index], plug_line[status_index])
+ if len(plug_line[0]) != 0:
+ outlets[plug_line[0]] = (plug_line[name_index], plug_line[status_index])
elif (plug_section == 1):
plug_section = 2
pass
13 years, 1 month
cluster: RHEL57 - fence_wti: Unable to parse output when splitted into several screens (2/2)
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 517c34c060d30e7467e316e96f389ced0c703ef1
Parent: b1dc0488fadd12866edd79433e52be33e8b7fd80
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Feb 21 20:55:30 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed Mar 16 14:44:08 2011 +0100
fence_wti: Unable to parse output when splitted into several screens (2/2)
Minor changes to previous patch. Power ON/OFF now works as expected
Resolves: rhbz#679160
---
fence/agents/wti/fence_wti.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index b980d41..c742e71 100755
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -29,13 +29,12 @@ def get_power_status(conn, options):
conn.send("/S"+"\r\n")
if isinstance(options["-c"], list):
- re_all = options["-c"]
+ re_all = list(options["-c"])
else:
re_all = [options["-c"]]
re_next = re.compile("Enter: ", re.IGNORECASE)
re_all.append(re_next)
- conn.send("/S"+"\r\n")
result = conn.log_expect(options, re_all, int(options["-Y"]))
listing = conn.before
if result == (len(re_all) - 1):
13 years, 1 month
cluster: RHEL6 - fence_scsi: grep for keys should be case insensitive
by rohara
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 18104afc78b4e5e0fd32cf002c99e33a5a3b052b
Parent: d7eae279296c350b25a26eb99bb7dd84acb0901d
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Tue Mar 15 15:18:56 2011 -0500
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Tue Mar 15 15:42:52 2011 -0500
fence_scsi: grep for keys should be case insensitive
When checking that a key is or is not registered for a device, the key
comparison should be case insensitive. Using sg_persist to query for
registered keys will always give lowercase characters for hexadecimal
keys, so registering key 'A' would appear to fail since it would not
match 'a'.
Resolves: rhbz#653504
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
fence/agents/scsi/fence_scsi.pl | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 14b0784..2751bed 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -73,7 +73,7 @@ sub do_action_off ($@)
log_error ("device $dev does not exist") if (! -e $dev);
log_error ("device $dev is not a block device") if (! -b $dev);
- my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
+ my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);
if (scalar (@keys) != 0) {
do_preempt_abort ($host_key, $node_key, $dev);
@@ -97,7 +97,7 @@ sub do_action_status ($@)
do_reset ($dev);
- my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
+ my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);
if (scalar (@keys) != 0) {
$dev_count++;
@@ -119,7 +119,7 @@ sub do_verify_on ($@)
my $count = 0;
for $dev (@devices) {
- my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
+ my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);
## check that our key is registered
if (scalar (@keys) == 0) {
@@ -150,7 +150,7 @@ sub do_verify_off ($@)
my $count = 0;
for $dev (@devices) {
- my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
+ my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);
## check that our key is not registered
if (scalar (@keys) != 0) {
13 years, 1 month
cluster: RHEL6 - Allow fence_scsi to use any valid hexadecimal key
by rohara
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: d7eae279296c350b25a26eb99bb7dd84acb0901d
Parent: 725381e831366ec7abd748b2777cfe43a3c5307b
Author: Jim Ramsay <jim_ramsay(a)dell.com>
AuthorDate: Fri Mar 4 14:04:03 2011 -0500
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Tue Mar 15 15:42:15 2011 -0500
Allow fence_scsi to use any valid hexadecimal key
The check for a non-zero key is using perl's implicit string-to-integer
conversion that only works on base 10 digits, which means that any key
starting with at least one digit [1-9] will come through as okay, but
any key starting with [A-F] will evaluate as 0 and fail the test.
An explicit conversion to integer via hex() is the solution.
I hit this in a cluster with a cluster ID of 43316 == 0xA934 and scsi
fencing configured, where starting the cman service would always fail at
the "Unfencing self" step.
Signed-off-by: Jim Ramsay <jim_ramsay(a)dell.com>
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
Resolves: rhbz#653504
---
fence/agents/scsi/fence_scsi.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index ba9770f..14b0784 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -787,7 +787,7 @@ else {
## verify that key is not zero
##
-if ($key == 0) {
+if (hex($key) == 0) {
log_error ("key cannot be zero");
}
13 years, 1 month