fence-agents: master - fence_hpblade: Fence agent for HP BladeSystem
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: fec84e4f9232dccb6c2d5b027e23dd67972080a5
Parent: 27b8e202d598563fdeb49c6cdaf540f25d5fb83b
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu May 31 14:57:10 2012 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu May 31 14:57:10 2012 +0200
fence_hpblade: Fence agent for HP BladeSystem
New fence agent for HP BladeSystem enclosures. Be aware that you will have to set -c / cmd_prompt as it vary a lot.
Resolves: rhbz#818337
---
configure.ac | 1 +
fence/agents/hpblade/Makefile.am | 17 +++++
fence/agents/hpblade/fence_hpblade.py | 115 +++++++++++++++++++++++++++++++++
fence/agents/lib/fencing.py.py | 3 +-
4 files changed, 135 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index dc35ea1..4797740 100644
--- a/configure.ac
+++ b/configure.ac
@@ -261,6 +261,7 @@ AC_CONFIG_FILES([Makefile
fence/agents/eaton_snmp/Makefile
fence/agents/egenera/Makefile
fence/agents/eps/Makefile
+ fence/agents/hpblade/Makefile
fence/agents/ibmblade/Makefile
fence/agents/ifmib/Makefile
fence/agents/ilo/Makefile
diff --git a/fence/agents/hpblade/Makefile.am b/fence/agents/hpblade/Makefile.am
new file mode 100644
index 0000000..e8ae6ff
--- /dev/null
+++ b/fence/agents/hpblade/Makefile.am
@@ -0,0 +1,17 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+TARGET = fence_hpblade
+
+SRC = $(TARGET).py
+
+EXTRA_DIST = $(SRC)
+
+sbin_SCRIPTS = $(TARGET)
+
+man_MANS = $(TARGET).8
+
+include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fenceman.mk
+
+clean-local: clean-man
+ rm -f $(TARGET)
diff --git a/fence/agents/hpblade/fence_hpblade.py b/fence/agents/hpblade/fence_hpblade.py
new file mode 100644
index 0000000..b4e9f1b
--- /dev/null
+++ b/fence/agents/hpblade/fence_hpblade.py
@@ -0,0 +1,115 @@
+#!/usr/bin/python
+
+#####
+##
+## The Following Agent Has Been Tested On:
+## * BladeSystem c7000 Enclosure
+#####
+
+import sys, re, pexpect, exceptions
+sys.path.append("@FENCEAGENTSLIBDIR@")
+from fencing import *
+
+#BEGIN_VERSION_GENERATION
+RELEASE_VERSION="New Bladecenter Agent - test release on steroids"
+REDHAT_COPYRIGHT=""
+BUILD_DATE="March, 2008"
+#END_VERSION_GENERATION
+
+def get_power_status(conn, options):
+ try:
+ conn.send_eol("show server status " + options["-n"])
+ conn.log_expect(options, options["-c"] , int(options["-Y"]))
+
+ power_re = re.compile("^\s*Power: (.*?)\s*$")
+ status = "unknown"
+ for line in conn.before.splitlines():
+ res = power_re.search(line)
+ if res != None:
+ status = res.group(1)
+
+ if status == "unknown":
+ if options.has_key("-M"):
+ return "off"
+ else:
+ fail(EC_STATUS)
+ except pexpect.EOF:
+ fail(EC_CONNECTION_LOST)
+ except pexpect.TIMEOUT:
+ fail(EC_TIMED_OUT)
+
+ return status.lower().strip()
+
+def set_power_status(conn, options):
+ try:
+ if options["-o"] == "on":
+ conn.send_eol("poweron server " + options["-n"])
+ elif options["-o"] == "off":
+ conn.send_eol("poweroff server " + options["-n"] + " force")
+ conn.log_expect(options, options["-c"], int(options["-Y"]))
+ except pexpect.EOF:
+ fail(EC_CONNECTION_LOST)
+ except pexpect.TIMEOUT:
+ fail(EC_TIMED_OUT)
+
+def get_blades_list(conn, options):
+ outlets = { }
+ try:
+ conn.send_eol("show server list" )
+ conn.log_expect(options, options["-c"], int(options["-Y"]))
+
+ list_re = re.compile("^\s*(.*?)\s+(.*?)\s+(.*?)\s+OK\s+(.*?)\s+(.*?)\s*$")
+ for line in conn.before.splitlines():
+ res = list_re.search(line)
+ if res != None:
+ outlets[res.group(1)] = (res.group(2), res.group(4).lower())
+ except pexpect.EOF:
+ fail(EC_CONNECTION_LOST)
+ except pexpect.TIMEOUT:
+ fail(EC_TIMED_OUT)
+
+ return outlets
+
+def main():
+ device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
+ "action", "ipaddr", "login", "passwd", "passwd_script",
+ "cmd_prompt", "secure", "port", "identity_file", "separator",
+ "inet4_only", "inet6_only", "ipport", "missing_as_off",
+ "power_timeout", "shell_timeout", "login_timeout", "power_wait"]
+
+ atexit.register(atexit_handler)
+
+ all_opt["cmd_prompt"]["default"] = "c7000oa>"
+
+ options = check_input(device_opt, process_input(device_opt))
+
+ docs = { }
+ docs["shortdesc"] = "Fence agent for HP BladeSystem"
+ docs["longdesc"] = "fence_hpblade is an I/O Fencing agent \
+which can be used with HP BladeSystem. It logs into an enclosure via telnet or ssh \
+and uses the command line interface to power on and off blades."
+ docs["vendorurl"] = "http://www.hp.com"
+ show_docs(options, docs)
+
+ ##
+ ## Operate the fencing device
+ ######
+ options["eol"] = "\n"
+ conn = fence_login(options)
+ result = fence_action(conn, options, set_power_status, get_power_status, get_blades_list)
+
+ ##
+ ## Logout from system
+ ######
+ try:
+ conn.send_eol("exit")
+ conn.close()
+ except exceptions.OSError:
+ pass
+ except pexpect.ExceptionPexpect:
+ pass
+
+ sys.exit(result)
+
+if __name__ == "__main__":
+ main()
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 2a62242..a9c287a 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -867,7 +867,8 @@ def fence_login(options):
if (options.has_key("-4")):
force_ipvx="-4 "
- options["eol"] = "\r\n"
+ if (options.has_key("eol") == False):
+ options["eol"] = "\r\n"
## Do the delay of the fence device before logging in
## Delay is important for two-node clusters fencing but we do not need to delay 'status' operations
11 years, 11 months
fence-agents: master - test commit
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 27b8e202d598563fdeb49c6cdaf540f25d5fb83b
Parent: 52eee63e2aad2434b996c4c19efe350510a9399b
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Wed May 30 09:03:28 2012 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed May 30 09:03:28 2012 +0200
test commit
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
configure.ac | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index e979675..dc35ea1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,3 @@
-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
11 years, 11 months
cluster: STABLE32 - rgmanager: Revert patch that caused a regression when operating on resources
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: c0afc6f3180dd61c9b212e2eb61cdc8d9c56af9f
Parent: 8f73b914907ad17d41be3b849cd936f77e8a6248
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Tue May 29 10:30:11 2012 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Tue May 29 10:30:11 2012 -0400
rgmanager: Revert patch that caused a regression when operating on resources
Revert "resrules: fix free while passing the pointer to caller"
This reverts commit 215dd94070707fdb421197bfe625fb9d531ecbec.
---
rgmanager/src/daemons/resrules.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/daemons/resrules.c b/rgmanager/src/daemons/resrules.c
index 557ef9c..104eb28 100644
--- a/rgmanager/src/daemons/resrules.c
+++ b/rgmanager/src/daemons/resrules.c
@@ -205,8 +205,11 @@ _get_version(xmlDocPtr doc, xmlXPathContextPtr ctx, char *base,
snprintf(xpath, sizeof(xpath), "%s/@version", base);
ret = xpath_get_one(doc, ctx, xpath);
- /* NULL or actual result of the query */
- rr->rr_version = ret;
+ if (ret) {
+ rr->rr_version = ret;
+ free(ret);
+ }
+ rr->rr_version = NULL;
}
11 years, 11 months
gfs2-utils: master - libgfs2: Use flags for versions in metadata description
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 9803f25df8f32c8eb4b99957097017df52bdd6fd
Parent: ea8be2c77e8a325c9b23cf7022a97db7210b500a
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri May 25 12:41:49 2012 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Fri May 25 12:41:49 2012 +0100
libgfs2: Use flags for versions in metadata description
Consolidate the .gfs1 and .gfs2 fields into one .versions field and add
constants so we can test lgfs2_metadata versions more easily.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/hexedit.c | 8 +++---
gfs2/libgfs2/libgfs2.h | 5 ++-
gfs2/libgfs2/meta.c | 67 ++++++++++++++++++++----------------------------
3 files changed, 35 insertions(+), 45 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index b4e6d15..2ff1125 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -813,14 +813,13 @@ int display_block_type(int from_restore)
return ret_type;
}
-static const struct lgfs2_metadata *find_mtype(uint32_t mtype, int gfs1)
+static const struct lgfs2_metadata *find_mtype(uint32_t mtype, const unsigned versions)
{
const struct lgfs2_metadata *m = lgfs2_metadata;
unsigned n = 0;
do {
- if (((gfs1 && m[n].gfs1) || (!gfs1 && m[n].gfs2))
- && m[n].mh_type == mtype)
+ if ((m[n].versions & versions) && m[n].mh_type == mtype)
return &m[n];
n++;
} while (n < lgfs2_metadata_size);
@@ -936,7 +935,8 @@ static int hexdump(uint64_t startaddr, int len)
}
print_gfs2("] ");
if (print_field >= 0) {
- const struct lgfs2_metadata *m = find_mtype(block_type, sbd.gfs1);
+ const struct lgfs2_metadata *m = find_mtype(block_type,
+ sbd.gfs1 ? LGFS2_MD_GFS1 : LGFS2_MD_GFS2);
if (m) {
const struct lgfs2_metafield *f;
unsigned n;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 8ed08dd..2fc47de 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -142,8 +142,9 @@ struct lgfs2_metafield {
};
struct lgfs2_metadata {
- const unsigned gfs1:1;
- const unsigned gfs2:1;
+ const unsigned versions:2;
+#define LGFS2_MD_GFS1 0x01
+#define LGFS2_MD_GFS2 0x02
const unsigned header:1;
const uint32_t mh_type;
const uint32_t mh_format;
diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c
index 1f796c8..a677cdc 100644
--- a/gfs2/libgfs2/meta.c
+++ b/gfs2/libgfs2/meta.c
@@ -478,7 +478,7 @@ RF(bt_pad)
const struct lgfs2_metadata lgfs2_metadata[] = {
[LGFS2_MT_GFS2_SB] = {
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_SB,
.mh_format = GFS2_FORMAT_SB,
@@ -488,7 +488,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_sb),
},
[LGFS2_MT_GFS_SB] = {
- .gfs1 = 1,
+ .versions = LGFS2_MD_GFS1,
.header = 1,
.mh_type = GFS2_METATYPE_SB,
.mh_format = GFS_FORMAT_SB,
@@ -498,15 +498,14 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs_sb),
},
[LGFS2_MT_RINDEX] = {
- .gfs1 = 1,
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS1 | LGFS2_MD_GFS2,
.name = "rindex",
.fields = gfs2_rindex_fields,
.nfields = ARRAY_SIZE(gfs2_rindex_fields),
.size = sizeof(struct gfs2_rindex),
},
[LGFS2_MT_GFS2_RGRP] = {
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_RG,
.mh_format = GFS2_FORMAT_RG,
@@ -516,7 +515,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_rgrp),
},
[LGFS2_MT_GFS_RGRP] = {
- .gfs1 = 1,
+ .versions = LGFS2_MD_GFS1,
.header = 1,
.mh_type = GFS2_METATYPE_RG,
.mh_format = GFS2_FORMAT_RG,
@@ -526,8 +525,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs_rgrp),
},
[LGFS2_MT_RGRP_BITMAP] = {
- .gfs1 = 1,
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS1 | LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_RB,
.mh_format = GFS2_FORMAT_RB,
@@ -537,7 +535,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_meta_header),
},
[LGFS2_MT_GFS2_DINODE] = {
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_DI,
.mh_format = GFS2_FORMAT_DI,
@@ -547,7 +545,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_dinode),
},
[LGFS2_MT_GFS_DINODE] = {
- .gfs1 = 1,
+ .versions = LGFS2_MD_GFS1,
.header = 1,
.mh_type = GFS2_METATYPE_DI,
.mh_format = GFS2_FORMAT_DI,
@@ -557,7 +555,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs_dinode),
},
[LGFS2_MT_GFS2_INDIRECT] = {
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_IN,
.mh_format = GFS2_FORMAT_IN,
@@ -567,7 +565,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_meta_header),
},
[LGFS2_MT_GFS_INDIRECT] = {
- .gfs1 = 1,
+ .versions = LGFS2_MD_GFS1,
.header = 1,
.mh_type = GFS2_METATYPE_IN,
.mh_format = GFS2_FORMAT_IN,
@@ -577,8 +575,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs_indirect),
},
[LGFS2_MT_DIR_LEAF] = {
- .gfs1 = 1,
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS1 | LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_LF,
.mh_format = GFS2_FORMAT_LF,
@@ -588,8 +585,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_leaf),
},
[LGFS2_MT_JRNL_DATA] = {
- .gfs1 = 1,
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS1 | LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_JD,
.mh_format = GFS2_FORMAT_JD,
@@ -599,7 +595,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_meta_header),
},
[LGFS2_MT_GFS2_LOG_HEADER] = {
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_LH,
.mh_format = GFS2_FORMAT_LH,
@@ -609,7 +605,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_log_header),
},
[LGFS2_MT_GFS_LOG_HEADER] = {
- .gfs1 = 1,
+ .versions = LGFS2_MD_GFS1,
.header = 1,
.mh_type = GFS2_METATYPE_LH,
.mh_format = GFS2_FORMAT_LH,
@@ -619,7 +615,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs_log_header),
},
[LGFS2_MT_GFS2_LOG_DESC] = {
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_LD,
.mh_format = GFS2_FORMAT_LD,
@@ -629,7 +625,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_log_descriptor),
},
[LGFS2_MT_GFS_LOG_DESC] = {
- .gfs1 = 1,
+ .versions = LGFS2_MD_GFS1,
.header = 1,
.mh_type = GFS2_METATYPE_LD,
.mh_format = GFS2_FORMAT_LD,
@@ -639,7 +635,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs_log_descriptor),
},
[LGFS2_MT_GFS2_LOG_BLOCK] = {
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_LB,
.mh_format = GFS2_FORMAT_LB,
@@ -649,8 +645,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_meta_header),
},
[LGFS2_MT_EA_ATTR] = {
- .gfs2 = 1,
- .gfs1 = 1,
+ .versions = LGFS2_MD_GFS1 | LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_EA,
.mh_format = GFS2_FORMAT_EA,
@@ -660,8 +655,7 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_meta_header),
},
[LGFS2_MT_EA_DATA] = {
- .gfs2 = 1,
- .gfs1 = 1,
+ .versions = LGFS2_MD_GFS1 | LGFS2_MD_GFS2,
.header = 1,
.mh_type = GFS2_METATYPE_ED,
.mh_format = GFS2_FORMAT_ED,
@@ -671,65 +665,60 @@ const struct lgfs2_metadata lgfs2_metadata[] = {
.size = sizeof(struct gfs2_meta_header),
},
[LGFS2_MT_GFS2_QUOTA_CHANGE] = {
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS2,
.name = "gfs2_quota_change",
.fields = gfs2_quota_change_fields,
.nfields = ARRAY_SIZE(gfs2_quota_change_fields),
.size = sizeof(struct gfs2_quota_change),
},
[LGFS2_MT_DIRENT] = {
- .gfs1 = 1,
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS1 | LGFS2_MD_GFS2,
.name = "gfs2_dirent",
.fields = gfs2_dirent_fields,
.nfields = ARRAY_SIZE(gfs2_dirent_fields),
.size = sizeof(struct gfs2_dirent),
},
[LGFS2_MT_EA_HEADER] = {
- .gfs1 = 1,
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS1 | LGFS2_MD_GFS2,
.name = "gfs2_ea_header",
.fields = gfs2_ea_header_fields,
.nfields = ARRAY_SIZE(gfs2_ea_header_fields),
.size = sizeof(struct gfs2_ea_header),
},
[LGFS2_MT_GFS2_INUM_RANGE] = {
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS2,
.name = "gfs2_inum_range",
.fields = gfs2_inum_range_fields,
.nfields = ARRAY_SIZE(gfs2_inum_range_fields),
.size = sizeof(struct gfs2_inum_range),
},
[LGFS2_MT_STATFS_CHANGE] = {
- .gfs1 = 1,
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS1 | LGFS2_MD_GFS2,
.name = "gfs2_statfs_change",
.fields = gfs2_statfs_change_fields,
.nfields = ARRAY_SIZE(gfs2_statfs_change_fields),
.size = sizeof(struct gfs2_statfs_change),
},
[LGFS2_MT_GFS_JINDEX] = {
- .gfs1 = 1,
+ .versions = LGFS2_MD_GFS1,
.name = "gfs_jindex",
.fields = gfs_jindex_fields,
.nfields = ARRAY_SIZE(gfs_jindex_fields),
.size = sizeof(struct gfs_jindex),
},
[LGFS2_MT_GFS_BLOCK_TAG] = {
- .gfs1 = 1,
+ .versions = LGFS2_MD_GFS1,
.name = "gfs_block_tag",
.fields = gfs_block_tag_fields,
.nfields = ARRAY_SIZE(gfs_block_tag_fields),
.size = sizeof(struct gfs_block_tag),
},
[LGFS2_MT_DATA] = {
- .gfs1 = 1,
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS1 | LGFS2_MD_GFS2,
.name = "data",
},
[LGFS2_MT_FREE] = {
- .gfs1 = 1,
- .gfs2 = 1,
+ .versions = LGFS2_MD_GFS1 | LGFS2_MD_GFS2,
.name = "free",
},
};
11 years, 11 months
gfs2-utils: master - gfs2_edit: Fix find_mtype and support gfs1 structures
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: b1a3d725b0b5cb448ed232fb325a696aa3d32932
Parent: 23393916ad3d8784befd9062c7faa1605199f1b5
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri May 25 02:42:30 2012 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Fri May 25 11:36:43 2012 +0100
gfs2_edit: Fix find_mtype and support gfs1 structures
Fixes up find_mtype to really iterate over the metadata array and to
choose between gfs2 and gfs1 structures.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/hexedit.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 69d1940..8311534 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -813,14 +813,15 @@ int display_block_type(int from_restore)
return ret_type;
}
-static const struct lgfs2_metadata *find_mtype(uint32_t mtype)
+static const struct lgfs2_metadata *find_mtype(uint32_t mtype, int gfs1)
{
const struct lgfs2_metadata *m = lgfs2_metadata;
unsigned n = 0;
do {
- if (m->gfs2 && m->mh_type == mtype)
- return m;
+ if (((gfs1 && m[n].gfs1) || (!gfs1 && m[n].gfs2))
+ && m[n].mh_type == mtype)
+ return &m[n];
n++;
} while (n < lgfs2_metadata_size);
@@ -934,7 +935,7 @@ static int hexdump(uint64_t startaddr, int len)
}
print_gfs2("] ");
if (print_field >= 0) {
- const struct lgfs2_metadata *m = find_mtype(get_block_type(bh));
+ const struct lgfs2_metadata *m = find_mtype(get_block_type(bh), sbd.gfs1);
if (m) {
const struct lgfs2_metafield *f;
unsigned n;
11 years, 11 months
gfs2-utils: master - gfs2_edit: Clean up some magic offsets
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: ea8be2c77e8a325c9b23cf7022a97db7210b500a
Parent: b1a3d725b0b5cb448ed232fb325a696aa3d32932
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri May 25 10:36:07 2012 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Fri May 25 11:36:47 2012 +0100
gfs2_edit: Clean up some magic offsets
Replace some uses of magic offsets with equivalent struct member
accesses.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/hexedit.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 8311534..b4e6d15 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -838,6 +838,7 @@ static int hexdump(uint64_t startaddr, int len)
uint64_t l;
const char *lpBuffer = bh->b_data;
int print_field, cursor_line;
+ const uint32_t block_type = get_block_type(bh);
strcpy(edit_fmt,"%02x");
pointer = (unsigned char *)lpBuffer + offset;
@@ -935,7 +936,7 @@ static int hexdump(uint64_t startaddr, int len)
}
print_gfs2("] ");
if (print_field >= 0) {
- const struct lgfs2_metadata *m = find_mtype(get_block_type(bh), sbd.gfs1);
+ const struct lgfs2_metadata *m = find_mtype(block_type, sbd.gfs1);
if (m) {
const struct lgfs2_metafield *f;
unsigned n;
@@ -951,9 +952,9 @@ static int hexdump(uint64_t startaddr, int len)
}
if (cursor_line) {
- if (((*(bh->b_data + 7) == GFS2_METATYPE_IN) ||
- (*(bh->b_data + 7) == GFS2_METATYPE_DI &&
- (*(bh->b_data + 0x8b) || *(bh->b_data + 0x8a))))) {
+ if (block_type == GFS2_METATYPE_IN ||
+ ((block_type == GFS2_METATYPE_DI) &&
+ ((struct gfs2_dinode*)bh->b_data)->di_height)) {
int ptroffset = edit_row[dmode] * 16 +
edit_col[dmode];
11 years, 11 months
gfs2-utils: master - gfs2-utils: Remove references to unlinked file tag
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 23393916ad3d8784befd9062c7faa1605199f1b5
Parent: f6cc05782370c12f8178b1f07ffaac8629657f3a
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu May 24 22:03:46 2012 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Fri May 25 11:36:38 2012 +0100
gfs2-utils: Remove references to unlinked file tag
Remove references to an obsolete unlinked tag file (or file tag).
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/libgfs2.h | 1 -
gfs2/man/gfs2_jadd.8 | 3 ---
gfs2/man/mkfs.gfs2.8 | 3 ---
gfs2/mkfs/main_mkfs.c | 5 +----
4 files changed, 1 insertions(+), 11 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index e2a7e45..8ed08dd 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -255,7 +255,6 @@ struct gfs2_sbd {
unsigned int bsize; /* The block size of the FS (in bytes) */
unsigned int jsize; /* Size of journals (in MB) */
unsigned int rgsize; /* Size of resource groups (in MB) */
- unsigned int utsize; /* Size of unlinked tag files (in MB) */
unsigned int qcsize; /* Size of quota change files (in MB) */
int debug;
diff --git a/gfs2/man/gfs2_jadd.8 b/gfs2/man/gfs2_jadd.8
index a645fb7..5453edd 100644
--- a/gfs2/man/gfs2_jadd.8
+++ b/gfs2/man/gfs2_jadd.8
@@ -50,9 +50,6 @@ The number of new journals to add.
\fB-q\fP
Be quiet. Don't print anything.
.TP
-\fB-u MegaBytes\fP
-Initial size of each journal's unlinked tag file
-.TP
\fB-V\fP
Version. Print version information, then exit.
.
diff --git a/gfs2/man/mkfs.gfs2.8 b/gfs2/man/mkfs.gfs2.8
index 63348f8..d17e272 100644
--- a/gfs2/man/mkfs.gfs2.8
+++ b/gfs2/man/mkfs.gfs2.8
@@ -75,9 +75,6 @@ Fsname is a unique file system name used to distinguish this GFS2 file
system from others created (1 to 16 characters). Lock_nolock doesn't
use this field.
.TP
-\fB-u\fP \fIMegaBytes\fR
-Initial size of each journal's unlinked tag file
-.TP
\fB-V\fP
Print program version information, then exit.
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 7c93621..e6b00a0 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -109,7 +109,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
sdp->orig_fssize = 0;
while (cont) {
- optchar = getopt(argc, argv, "-b:c:DhJ:j:KOp:qr:t:u:VX");
+ optchar = getopt(argc, argv, "-b:c:DhJ:j:KOp:qr:t:VX");
switch (optchar) {
case 'b':
@@ -166,9 +166,6 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
strcpy(sdp->locktable, optarg);
break;
- case 'u':
- break;
-
case 'V':
printf("gfs2_mkfs %s (built %s %s)\n", VERSION,
__DATE__, __TIME__);
11 years, 11 months
cluster: RHEL59 - 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: e512a9ce367da0bb251559452023ce11f4506f27
Parent: 1d1ba64f39fe8a16deef298aa1e36cf6333daa30
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: Thu May 24 08:39:24 2012 +0200
rgmanager: add nfsdrestart option as last resource to umount fs/clustefs
Resolves: rhbz#822066
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
dlm: tag 3.99.4 has been created
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 88e1465323ef4689281df9282a21a407ceae59bf
Parent: cd549713be75a7539e5c5ba3584b5b2796bfb652
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon May 21 13:07:20 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon May 21 13:07:20 2012 -0500
release 3.99.4
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
include/version.cf | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/version.cf b/include/version.cf
index 41cd547..3923440 100644
--- a/include/version.cf
+++ b/include/version.cf
@@ -1,6 +1,6 @@
#ifndef _RELEASE_VERSION_CF_
#define _RELEASE_VERSION_CF_
-#define RELEASE_VERSION "3.99.3"
+#define RELEASE_VERSION "3.99.4"
#endif
11 years, 11 months
dlm: master - release 3.99.4
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 88e1465323ef4689281df9282a21a407ceae59bf
Parent: cd549713be75a7539e5c5ba3584b5b2796bfb652
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon May 21 13:07:20 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon May 21 13:07:20 2012 -0500
release 3.99.4
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
include/version.cf | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/version.cf b/include/version.cf
index 41cd547..3923440 100644
--- a/include/version.cf
+++ b/include/version.cf
@@ -1,6 +1,6 @@
#ifndef _RELEASE_VERSION_CF_
#define _RELEASE_VERSION_CF_
-#define RELEASE_VERSION "3.99.3"
+#define RELEASE_VERSION "3.99.4"
#endif
11 years, 11 months