Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=2d…
Commit: 2d4b69c5caab8afe96d35506da9829a6f921cb94
Parent: 53fce21aa1b568e3ae65393f1fbce826a3d5c7ef
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Feb 16 18:18:31 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Feb 25 10:04:59 2011 +0100
fence agents: add XSLT template
---
fence/agents/lib/fence2man.xsl | 53 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/fence/agents/lib/fence2man.xsl b/fence/agents/lib/fence2man.xsl
new file mode 100644
index 0000000..563b3a4
--- /dev/null
+++ b/fence/agents/lib/fence2man.xsl
@@ -0,0 +1,53 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="text" indent="no"/>
+<xsl:template match="parameter">
+<xsl:param name="show" />
+.TP
+<xsl:if test="$show = 'getopt'">.B <xsl:value-of select="getopt/@mixed" /></xsl:if>
+<xsl:if test="$show = 'stdin'">.B <xsl:value-of select="@name"/></xsl:if>
+.
+<xsl:value-of select="normalize-space(shortdesc)"/>
+<xsl:if test="not(content/@default)"><xsl:if test="@required = 1"> This parameter is always required.</xsl:if></xsl:if>
+<xsl:if test="content/@default"> (Default Value: <xsl:value-of select="content/@default"/>)</xsl:if>
+</xsl:template>
+
+<xsl:template match="action">
+.TP
+\fB<xsl:value-of select="@name"/> \fP
+<xsl:choose>
+<xsl:when test="@name = 'on'">Power on machine.</xsl:when>
+<xsl:when test="@name = 'off'">Power off machine.</xsl:when>
+<xsl:when test="@name = 'reboot'">Reboot machine.</xsl:when>
+<xsl:when test="@name = 'monitor'">Check if fencing device is running. List available plugs/virtual machines or get status of machine (if it does not support more).</xsl:when>
+<xsl:when test="@name = 'meta-data'">Display the XML metadata describing this resource.</xsl:when>
+<xsl:when test="@name = 'list'">List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise.</xsl:when>
+<xsl:when test="@name = 'status'">This returns the status of the plug/virtual machine.</xsl:when>
+<!-- Ehhh -->
+<xsl:otherwise> The operational behavior of this is not known.</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<xsl:template match="/resource-agent">
+.TH FENCE_AGENT 8 2009-10-20 "<xsl:value-of select="@name"/> (Fence Agent)"
+.SH NAME
+<xsl:value-of select="@name" /> - <xsl:value-of select="@shortdesc" />
+.SH DESCRIPTION
+.P
+<xsl:value-of select="longdesc"/>
+.P
+<xsl:value-of select="@name" /> accepts options on the command line as well
+as from stdin. Fenced sends parameters through stdin when it execs the
+agent. <xsl:value-of select="@name" /> can be run by itself with command
+line options. This is useful for testing and for turning outlets on or off
+from scripts.
+<xsl:if test="vendor-url">
+Vendor URL: <xsl:value-of select="vendor-url" />
+</xsl:if>
+.SH PARAMETERS
+<xsl:apply-templates select="parameters"><xsl:with-param name="show">getopt</xsl:with-param></xsl:apply-templates>
+.SH ACTIONS
+<xsl:apply-templates select="actions"/>
+.SH STDIN PARAMETERS
+<xsl:apply-templates select="parameters"><xsl:with-param name="show">stdin</xsl:with-param></xsl:apply-templates>
+</xsl:template>
+</xsl:stylesheet>
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ae…
Commit: ae7be075867909d08ec2bfbae8a7847a1a838580
Parent: 56b618c99947d457579c6bc9f0a1de4aae329595
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Feb 16 17:04:51 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Feb 25 10:04:19 2011 +0100
fence-agents: Automatic generation of manual pages
Change build system to create manual pages directly from fence agents.
Resolves: rhbz#488959
---
fence/agents/apc/Makefile | 10 +-
fence/agents/apc_snmp/Makefile | 10 +-
fence/agents/bladecenter/Makefile | 10 +-
fence/agents/cisco_mds/Makefile | 10 +-
fence/agents/cisco_ucs/Makefile | 10 +-
fence/agents/drac/Makefile | 10 +-
fence/agents/eps/Makefile | 10 +-
fence/agents/ibmblade/Makefile | 18 ++-
fence/agents/ifmib/Makefile | 10 +-
fence/agents/ilo/Makefile | 10 +-
fence/agents/ilo_mp/Makefile | 10 +-
fence/agents/ipmilan/Makefile | 15 ++-
fence/agents/lpar/Makefile | 11 +-
fence/agents/rhevm/Makefile | 10 +-
fence/agents/rsa/Makefile | 10 +-
fence/agents/sanbox2/Makefile | 10 +-
fence/agents/virsh/Makefile | 10 +-
fence/agents/vmware/Makefile | 10 +-
fence/agents/wti/Makefile | 10 +-
fence/make/defines.mk.input | 7 +
fence/man/Makefile | 14 --
fence/man/fence_apc.8 | 99 -----------
fence/man/fence_bladecenter.8 | 96 -----------
fence/man/fence_cisco_mds.8 | 132 ---------------
fence/man/fence_cisco_ucs.8 | 251 ----------------------------
fence/man/fence_eps.8 | 106 ------------
fence/man/fence_ibmblade.8 | 68 --------
fence/man/fence_ifmib.8 | 323 -------------------------------------
fence/man/fence_ilo.8 | 95 -----------
fence/man/fence_ipmilan.8 | 111 -------------
fence/man/fence_lpar.8 | 116 -------------
fence/man/fence_rsa.8 | 69 --------
fence/man/fence_sanbox2.8 | 83 ----------
fence/man/fence_vmware.8 | 137 ----------------
fence/man/fence_wti.8 | 84 ----------
35 files changed, 168 insertions(+), 1827 deletions(-)
diff --git a/fence/agents/apc/Makefile b/fence/agents/apc/Makefile
index c33350a..a1f1570 100644
--- a/fence/agents/apc/Makefile
+++ b/fence/agents/apc/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_apc.py
TARGET= fence_apc
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_apc: fence_apc.py
: > $(TARGET)
@@ -34,5 +35,10 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/apc_snmp/Makefile b/fence/agents/apc_snmp/Makefile
index 29a0df7..b10a9ab 100644
--- a/fence/agents/apc_snmp/Makefile
+++ b/fence/agents/apc_snmp/Makefile
@@ -14,11 +14,12 @@
SOURCE= fence_apc_snmp.py
TARGET= fence_apc_snmp
RESOURCE= powernet369.mib
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_apc_snmp: fence_apc_snmp.py
: > $(TARGET)
@@ -40,5 +41,10 @@ install: all
fi
install -m755 ${RESOURCE} ${mibdir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/bladecenter/Makefile b/fence/agents/bladecenter/Makefile
index 34dd24d..55f0164 100644
--- a/fence/agents/bladecenter/Makefile
+++ b/fence/agents/bladecenter/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_bladecenter.py
TARGET= fence_bladecenter
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_bladecenter: fence_bladecenter.py
: > $(TARGET)
@@ -33,6 +34,11 @@ install: all
install -d ${sbindir}; \
fi
install -m755 ${TARGET} ${sbindir}
+
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/cisco_mds/Makefile b/fence/agents/cisco_mds/Makefile
index f61b83b..d53bbe4 100644
--- a/fence/agents/cisco_mds/Makefile
+++ b/fence/agents/cisco_mds/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_cisco_mds.py
TARGET= fence_cisco_mds
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_cisco_mds: fence_cisco_mds.py
: > $(TARGET)
@@ -34,5 +35,10 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/cisco_ucs/Makefile b/fence/agents/cisco_ucs/Makefile
index 5875ba0..016a009 100644
--- a/fence/agents/cisco_ucs/Makefile
+++ b/fence/agents/cisco_ucs/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_cisco_ucs.py
TARGET= fence_cisco_ucs
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_cisco_ucs: fence_cisco_ucs.py
: > $(TARGET)
@@ -34,5 +35,10 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/drac/Makefile b/fence/agents/drac/Makefile
index ce84f20..208748c 100644
--- a/fence/agents/drac/Makefile
+++ b/fence/agents/drac/Makefile
@@ -16,11 +16,12 @@ TARGET1= fence_drac
SOURCE2= fence_drac5.py
TARGET2= fence_drac5
+MANTARGET= $(TARGET2).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET1) $(TARGET2)
+all: $(TARGET1) $(TARGET2) $(MANTARGET)
fence_drac: fence_drac.pl
: > $(TARGET1)
@@ -46,5 +47,10 @@ install: all
fi
install -m755 ${TARGET1} ${TARGET2} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET1) $(TARGET2)
+ rm -f $(TARGET1) $(TARGET2) $(MANTARGET)
diff --git a/fence/agents/eps/Makefile b/fence/agents/eps/Makefile
index 3e086c9..244f24c 100644
--- a/fence/agents/eps/Makefile
+++ b/fence/agents/eps/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_eps.py
TARGET= fence_eps
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_eps: fence_eps.py
: > $(TARGET)
@@ -34,5 +35,10 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/ibmblade/Makefile b/fence/agents/ibmblade/Makefile
index ec8e62b..1f8b3de 100644
--- a/fence/agents/ibmblade/Makefile
+++ b/fence/agents/ibmblade/Makefile
@@ -13,18 +13,19 @@
SOURCE= fence_ibmblade.py
TARGET= fence_ibmblade
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
$(TARGET): $(SOURCE)
: > $(TARGET)
awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(SOURCE) >> $(TARGET)
- echo "\$$FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET)
- ${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf perl REDHAT_COPYRIGHT >> $(TARGET)
- echo "\$$BUILD_DATE=\"(built `date`)\";" >> $(TARGET)
+ echo "FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET)
+ ${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf sh REDHAT_COPYRIGHT >> $(TARGET)
+ echo "BUILD_DATE=\"(built `date`)\";" >> $(TARGET)
awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(SOURCE) >> $(TARGET)
chmod +x $(TARGET)
@@ -33,8 +34,11 @@ install: all
install -d ${sbindir}; \
fi
install -m755 ${TARGET} ${sbindir}
+
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
clean:
- rm -f $(TARGET)
-
-
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/ifmib/Makefile b/fence/agents/ifmib/Makefile
index e564689..7a6a643 100644
--- a/fence/agents/ifmib/Makefile
+++ b/fence/agents/ifmib/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_ifmib.py
TARGET= fence_ifmib
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_ifmib: $(SOURCE)
: > $(TARGET)
@@ -34,5 +35,10 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/ilo/Makefile b/fence/agents/ilo/Makefile
index 089266e..4e2f408 100644
--- a/fence/agents/ilo/Makefile
+++ b/fence/agents/ilo/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_ilo.py
TARGET= fence_ilo
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_ilo: $(SOURCE)
: > $(TARGET)
@@ -33,6 +34,11 @@ install: all
install -d ${sbindir}; \
fi
install -m755 ${TARGET} ${sbindir}
+
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/ilo_mp/Makefile b/fence/agents/ilo_mp/Makefile
index f6e1ddf..aadf954 100644
--- a/fence/agents/ilo_mp/Makefile
+++ b/fence/agents/ilo_mp/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_ilo_mp.py
TARGET= fence_ilo_mp
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_ilo_mp: $(SOURCE)
: > $(TARGET)
@@ -34,5 +35,10 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/ipmilan/Makefile b/fence/agents/ipmilan/Makefile
index 70b9f84..1c84ea3 100644
--- a/fence/agents/ipmilan/Makefile
+++ b/fence/agents/ipmilan/Makefile
@@ -12,6 +12,7 @@
###############################################################################
TARGET= fence_ipmilan
+MANTARGETX= $(TARGET).8
fence_ipmilan_SOURCE= expect.c ipmilan.c
@@ -25,16 +26,26 @@ include ${top_srcdir}/make/defines.mk
CFLAGS+= -DFENCE_RELEASE_NAME=\"${RELEASE}\" -DFENCE
-all: ${TARGET}
+all: ${TARGET} $(MANTARGETX)
fence_ipmilan: ${fence_ipmilan_SOURCE:.c=.o}
${CC} ${CFLAGS} ${LDFLAGS} ${fence_ipmilan_SOURCE:.c=.o} -o $@
+$(MANTARGETX): $(MANTARGETX:.8=) $(top_srcdir)/agents/lib/fence2man.xsl
+ set -e && \
+ ./fence_ipmilan -o metadata > .$@.tmp && \
+ xsltproc $(top_srcdir)/agents/lib/fence2man.xsl .$@.tmp > $@
+
install: all
if [ ! -d ${sbindir} ]; then \
install -d ${sbindir}; \
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGETX} ${mandir}/man8
+
clean:
- rm -f *.o ${TARGET}
+ rm -f *.o ${TARGET} $(MANTARGETX)
diff --git a/fence/agents/lpar/Makefile b/fence/agents/lpar/Makefile
index 142582a..059cb12 100644
--- a/fence/agents/lpar/Makefile
+++ b/fence/agents/lpar/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_lpar.py
TARGET= fence_lpar
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_lpar: fence_lpar.py
: > $(TARGET)
@@ -34,5 +35,11 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/rhevm/Makefile b/fence/agents/rhevm/Makefile
index 4315a91..d870c16 100644
--- a/fence/agents/rhevm/Makefile
+++ b/fence/agents/rhevm/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_rhevm.py
TARGET= fence_rhevm
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_rhevm: $(SOURCE)
: > $(TARGET)
@@ -34,5 +35,10 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/rsa/Makefile b/fence/agents/rsa/Makefile
index 0b948cc..2288891 100644
--- a/fence/agents/rsa/Makefile
+++ b/fence/agents/rsa/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_rsa.py
TARGET= fence_rsa
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_rsa: fence_rsa.py
: > $(TARGET)
@@ -34,5 +35,10 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/sanbox2/Makefile b/fence/agents/sanbox2/Makefile
index f6d84bb..cb5515f 100644
--- a/fence/agents/sanbox2/Makefile
+++ b/fence/agents/sanbox2/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_sanbox2.py
TARGET= fence_sanbox2
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
$(TARGET): $(SOURCE)
: > $(TARGET)
@@ -34,7 +35,12 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/virsh/Makefile b/fence/agents/virsh/Makefile
index 45ca6bf..9e972aa 100644
--- a/fence/agents/virsh/Makefile
+++ b/fence/agents/virsh/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_virsh.py
TARGET= fence_virsh
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
fence_virsh: fence_virsh.py
: > $(TARGET)
@@ -34,6 +35,11 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
+
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/agents/vmware/Makefile b/fence/agents/vmware/Makefile
index 1795e63..c893406 100644
--- a/fence/agents/vmware/Makefile
+++ b/fence/agents/vmware/Makefile
@@ -13,6 +13,7 @@
SOURCE= fence_vmware.py
TARGET= fence_vmware
+MANTARGET= $(TARGET).8
SOURCE2= fence_vmware_helper.pl
TARGET2= fence_vmware_helper
@@ -20,7 +21,7 @@ TARGET2= fence_vmware_helper
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET) $(TARGET2)
+all: $(TARGET) $(TARGET2) $(MANTARGET)
$(TARGET): $(SOURCE)
: > $(TARGET)
@@ -46,7 +47,12 @@ install: all
fi
install -m755 ${TARGET} ${sbindir}
install -m755 ${TARGET2} ${sbindir}
+
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
clean:
- rm -f $(TARGET) $(TARGET2)
+ rm -f $(TARGET) $(TARGET2) $(MANTARGET)
diff --git a/fence/agents/wti/Makefile b/fence/agents/wti/Makefile
index 73f42a4..ff8ca35 100644
--- a/fence/agents/wti/Makefile
+++ b/fence/agents/wti/Makefile
@@ -13,11 +13,12 @@
SOURCE= fence_wti.py
TARGET= fence_wti
+MANTARGET= $(TARGET).8
top_srcdir=../..
include ${top_srcdir}/make/defines.mk
-all: $(TARGET)
+all: $(TARGET) $(MANTARGET)
$(TARGET): $(SOURCE)
: > $(TARGET)
@@ -33,7 +34,12 @@ install: all
install -d ${sbindir}; \
fi
install -m755 ${TARGET} ${sbindir}
+
+ if [ ! -d ${mandir}/man8 ]; then \
+ install -d ${mandir}/man8; \
+ fi
+ install -m644 ${MANTARGET} ${mandir}/man8
clean:
- rm -f $(TARGET)
+ rm -f $(TARGET) $(MANTARGET)
diff --git a/fence/make/defines.mk.input b/fence/make/defines.mk.input
index b270dea..4c5b40f 100644
--- a/fence/make/defines.mk.input
+++ b/fence/make/defines.mk.input
@@ -40,3 +40,10 @@ RANLIB = ranlib
# Default CFLAGS
CFLAGS += -Wall ${INCLUDE}
+
+$(MANTARGET): $(MANTARGET:.8=) $(top_srcdir)/agents/lib/fence2man.xsl
+ set -e && \
+ PYTHONPATH=$(top_srcdir)/agents/lib \
+ python $^ -o metadata > .$@.tmp && \
+ xsltproc $(top_srcdir)/agents/lib/fence2man.xsl .$@.tmp > $@
+
diff --git a/fence/man/Makefile b/fence/man/Makefile
index ad64c0c..3ccc8e6 100644
--- a/fence/man/Makefile
+++ b/fence/man/Makefile
@@ -14,34 +14,20 @@
TARGET8= \
fence.8 \
fence_ack_manual.8 \
- fence_apc.8 \
- fence_rsa.8 \
- fence_bladecenter.8 \
fence_brocade.8 \
- fence_cisco_mds.8 \
fence_drac.8 \
fence_egenera.8 \
- fence_eps.8 \
- fence_ilo.8 \
- fence_lpar.8 \
fence_manual.8 \
fence_mcdata.8 \
fence_node.8 \
fence_rib.8 \
- fence_sanbox2.8 \
fence_scsi.8 \
fence_scsi_test.8 \
fence_tool.8 \
fence_vixel.8 \
- fence_wti.8 \
fence_bullpap.8 \
- fence_ipmilan.8 \
- fence_vmware.8 \
fence_xvm.8 \
fence_xvmd.8 \
- fence_cisco_ucs.8 \
- fence_ifmib.8 \
- fence_rhevm.8 \
fenced.8
UNINSTALL=${top_srcdir}/scripts/uninstall.pl
diff --git a/fence/man/fence_apc.8 b/fence/man/fence_apc.8
deleted file mode 100644
index 45825dc..0000000
--- a/fence/man/fence_apc.8
+++ /dev/null
@@ -1,99 +0,0 @@
-.\" Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-.\" Copyright (C) 2004 Red Hat, Inc. All rights reserved.
-.\"
-.\" This copyrighted material is made available to anyone wishing to use,
-.\" modify, copy, or redistribute it subject to the terms and conditions
-.\" of the GNU General Public License v.2.
-
-.TH fence_apc 8
-
-.SH NAME
-fence_apc - I/O Fencing agent for APC MasterSwitch
-
-.SH SYNOPSIS
-.B
-fence_apc
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_apc is an I/O Fencing agent which can be used with the APC network
-power switch. It logs into device via telnet/ssh and reboots a specified
-outlet. Lengthy telnet/ssh connections should be avoided while a GFS
-cluster is running because the connection will block any necessary
-fencing actions.
-
-fence_apc accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_apc
-can be run by itself with command line options. This is useful for testing
-and for turning outlets on or off from scripts.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-n\fP \fI[<switch>:]outlet\fR
-The outlet number to act upon.
-.TP
-\fB-o\fP \fIaction\fR
-The action required. Reboot (default), Status, Off or On.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login or for passphrase.
-.TP
-\fB-S\fP \fIscript\fR
-Script to run to retrieve password.
-.TP
-\fB-x\fP
-Use secure connection over ssh (using version 1, cipher blowfish).
-.TP
-\fB-T\fP
-Test only. Answer NO to the confirmation prompt instead of YES.
-.TP
-\fB-v\fP
-Verbose. Record telnet session in /tmp/apclog.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_apc.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. Reboot (default), Off or On.
-.TP
-\fIpasswd = < param >\fR
-Password for login or for passphrase.
-\fIpasswd_script = < param >\fR
-Script to run to retrieve password.
-\fIsecure = < param >\fR
-Use secure connection over ssh.
-.TP
-\fIport = < param >\fR
-The outlet number to act upon.
-.TP
-\fIswitch = < param >\fR
-The switch to operate on. Defaults to "1" if not specified.
-.TP
-\fItest = < param >\fR
-Test only. Answer NO to the confirmation prompt instead of YES.
-.TP
-\fIverbose = < param >\fR
-Verbose. Record telnet session in /tmp/apclog.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/man/fence_bladecenter.8 b/fence/man/fence_bladecenter.8
deleted file mode 100644
index 70c0b00..0000000
--- a/fence/man/fence_bladecenter.8
+++ /dev/null
@@ -1,96 +0,0 @@
-.\" Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-.\" Copyright (C) 2004 Red Hat, Inc. All rights reserved.
-.\"
-.\" This copyrighted material is made available to anyone wishing to use,
-.\" modify, copy, or redistribute it subject to the terms and conditions
-.\" of the GNU General Public License v.2.
-
-.TH fence_bladecenter 8
-
-.SH NAME
-fence_bladecenter - I/O Fencing agent for IBM Bladecenter
-
-.SH SYNOPSIS
-.B
-fence_bladecenter
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_bladecenter is an I/O Fencing agent which can be used with IBM
-Bladecenters with recent enough firmware that includes telnet support. It
-logs into a Brocade chasis via telnet or ssh and uses the command line
-interface to power on and off blades. fence_bladecenter accepts options on
-the command line or from stdin.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the Bladecenter.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login name for the Bladecenter.
-.TP
-\fB-n\fP \fIblade\fP
-The blade to operate on.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. Valid actions are on, off, reboot (default) and status.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login or for passphrase.
-.TP
-\fB-S\fP \fIscript\fR
-Script to run to retrieve password.
-.TP
-\fB-k\fP \fIidentity\fR
-Identity file (private key) for ssh connection.
-.TP
-\fB-x\fP
-Use secure connection over ssh.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-.TP
-\fB-v\fP \fIdebuglog\fP
-Log the telnet session to \fIdebuglog\fP for debugging purposes.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_bladecenter.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. disable (default) or enable.
-.TP
-\fIpasswd = < param >\fR
-Password for login or for passphrase.
-.TP
-\fIpasswd_script = < param >\fR
-Script to run to retrieve password.
-.TP
-\fIidentity_file = < param > \fR
-Identity file (private key) for ssh.
-.TP
-\fIsecure = < param >\fR
-Use secure connection over ssh.
-.TP
-\fIblade = < param >\fR
-The blade to operate on.
-.TP
-\fIdebuglog = < param>\fR
-Optional parameter to send debug transcript of the telnet session to a log file
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/man/fence_cisco_mds.8 b/fence/man/fence_cisco_mds.8
deleted file mode 100644
index 8c58d63..0000000
--- a/fence/man/fence_cisco_mds.8
+++ /dev/null
@@ -1,132 +0,0 @@
-.TH fence_cisco_mds 8
-
-.SH NAME
-fence_cisco_mds - I/O Fencing agent for Cisco MDS 9000 series SNMP devices
-
-.SH SYNOPSIS
-.B
-fence_cisco_mds
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_cisco_mds is an I/O Fencing agent which can be used with any Cisco MDS
-9000 series with SNMP enabled device. Agent internally uses snmpget, snmpset
-and snmpwalk command.
-
-fence_cisco_mds accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_cisco_mds
-can be run by itself with command line options. This is useful for testing.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of the Cisco device. Can be used any syntax supported by snmpget.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-c\fP \fIcommunity\fR
-The read/write community string to be used in the request.
-.TP
-\fB-n\fP \fIname\fR
-Name of port to fence (fc1/1)
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login for SNMP v3 (authentication protocol pass phrase).
-.TP
-\fB-P\fP \fIpassword\fR
-Password for privacy for SNMP v3 (privacy protocol password).
-.TP
-\fB-S\fP \fIscript\fR
-Script to run to retrieve password for login for SNMP v3 (authentication protocol pass phrase).
-.TP
-\fB-R\fP \fIscript\fR
-Script to run to retrieve privacy for SNMP v3 (privacy protocol password).
-.TP
-\fB-l\fP \fIlogin\fR
-Login name for SNMP v3 (security name).
-.TP
-\fB-d\fP \fIversion\fR
-SNMP version (1,2c,3).
-.TP
-\fB-b\fP \fIauth_protocol\fR
-SNMP authentication protocol (MD5|SHA).
-.TP
-\fB-E\fP \fIsec_level\fR
-SNMP security level (noAuthNoPriv|authNoPriv|authPriv).
-.TP
-\fB-B\fP \fIpriv_protocol\fR
-SNMP privacy protocol (DES|AES).
-.TP
-\fB-u\fP \fIudp_port\fR
-UDP/TCP port to use.
-.TP
-\fB-o\fP \fIaction\fR
-The action required. off (default), on, status, list or monitor. Deprecated
-options (enable -> on and disable -> off) can be used too.
-.TP
-\fB-v\fP
-Verbose. Record session to stdout, or debug file if specified (see -D).
-.TP
-\fB-D\fP
-Specifies file, where will be written debug messages from session.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_cisco_mds.
-.TP
-\fIipaddr = < param >\fR
-IP address or hostname of the Cisco device. Can be used any syntax supported by snmpget.
-.TP
-\fIcommunity = < param >\fR
-The read/write community string to be used in the request.
-.TP
-\fIport = < param >\fR
-Name of port to fence (fc1/1)
-.TP
-\fIpasswd = < param >\fR
-Password for login for SNMP v3 (authentication protocol pass phrase).
-.TP
-\fIsnmp_priv_passwd\fR
-Password for privacy for SNMP v3 (privacy protocol password).
-.TP
-\fIpasswd_script = < param >\fR
-Script to run to retrieve password for login for SNMP v3 (authentication protocol pass phrase).
-.TP
-\fIsnmp_priv_passwd_script = < param>\fR
-Password for privacy for SNMP v3 (privacy protocol password).
-.TP
-\fIlogin = < param >\fR
-Login name for SNMP v3 (security name).
-.TP
-\fIsnmp_version = < param >\fR
-SNMP version (1,2c,3).
-.TP
-\fIsnmp_auth_prot = < param >\fR
-SNMP authentication protocol (MD5|SHA).
-.TP
-\fIsnmp_sec_level = < param >\fR
-SNMP security level (noAuthNoPriv|authNoPriv|authPriv).
-.TP
-\fIsnmp_priv_prot = < param >\fR
-SNMP privacy protocol (DES|AES).
-.TP
-\fIudpport = < param >\fR
-UDP/TCP port to use.
-.TP
-\fIaction = < param >\fR
-The action required. off (default), on, status, list or monitor. Deprecated
-options (enable -> on and disable -> off) can be used too.
-.TP
-\fIverbose = < param >\fR
-Verbose. Record session to stdout, or debug file if specified (see debug).
-.TP
-\fIdebug = < param >\fR
-Specifies file, where will be written debug messages from session.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/man/fence_cisco_ucs.8 b/fence/man/fence_cisco_ucs.8
deleted file mode 100644
index 6afa32b..0000000
--- a/fence/man/fence_cisco_ucs.8
+++ /dev/null
@@ -1,251 +0,0 @@
-
-.TH FENCE_AGENT 8 2009-10-20 "fence_cisco_ucs (Fence Agent)"
-.SH NAME
-fence_cisco_ucs - Fence agent for Cisco UCS
-.SH DESCRIPTION
-.P
-fence_cisco_ucs is an I/O Fencing agent which can be used with Cisco UCS to fence machines.
-.P
-fence_cisco_ucs accepts options on the command line as well
-as from stdin. Fenced sends parameters through stdin when it execs the
-agent. fence_cisco_ucs can be run by itself with command
-line options. This is useful for testing and for turning outlets on or off
-from scripts.
-
-Vendor URL: http://www.cisco.com
-.SH PARAMETERS
-
-
-.TP
-.B -o, --action=<action>
-.
-Fencing Action (Default Value: reboot)
-
-.TP
-.B -a, --ip=<ip>
-.
-IP Address or Hostname This parameter is always required.
-
-.TP
-.B -l, --username=<name>
-.
-Login Name This parameter is always required.
-
-.TP
-.B -p, --password=<password>
-.
-Login password or passphrase
-
-.TP
-.B -S, --password-script=<script>
-.
-Script to retrieve password
-
-.TP
-.B -z, --ssl
-.
-SSL connection
-
-.TP
-.B -4, --inet4-only
-.
-Forces agent to use IPv4 addresses only
-
-.TP
-.B -6, --inet6-only
-.
-Forces agent to use IPv6 addresses only
-
-.TP
-.B -u, --ipport=<port>
-.
-TCP port to use for connection with device
-
-.TP
-.B -n, --plug=<id>
-.
-Physical plug number or name of virtual machine This parameter is always required.
-
-.TP
-.B -v, --verbose
-.
-Verbose mode
-
-.TP
-.B -D, --debug-file=<debugfile>
-.
-Write debug information to given file
-
-.TP
-.B -V, --version
-.
-Display version information and exit
-
-.TP
-.B -h, --help
-.
-Display help and exit
-
-.TP
-.B -C, --separator=<char>
-.
-Separator for CSV created by operation list (Default Value: ,)
-
-.TP
-.B --power-wait
-.
-Wait X seconds after issuing ON/OFF (Default Value: 0)
-
-.TP
-.B --power-timeout
-.
-Test X seconds for status change after ON/OFF (Default Value: 20)
-
-.TP
-.B --shell-timeout
-.
-Wait X seconds for cmd prompt after issuing command (Default Value: 3)
-
-.TP
-.B --retry-on
-.
-Count of attempts to retry power on (Default Value: 1)
-
-.TP
-.B --delay
-.
-Wait X seconds before fencing is started (Default Value: 0)
-
-.SH ACTIONS
-
-
-.TP
-\fBon \fP
-Power on machine.
-
-.TP
-\fBoff \fP
-Power off machine.
-
-.TP
-\fBreboot \fP
-Reboot machine.
-
-.TP
-\fBstatus \fP
-This returns the status of the plug/virtual machine.
-
-.TP
-\fBlist \fP
-List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise.
-
-.TP
-\fBmonitor \fP
-Check if fencing device is running. List available plugs/virtual machines or get status of machine (if it does not support more).
-
-.TP
-\fBmetadata \fP
- The operational behavior of this is not known.
-
-.SH STDIN PARAMETERS
-
-
-.TP
-.B action
-.
-Fencing Action (Default Value: reboot)
-
-.TP
-.B ipaddr
-.
-IP Address or Hostname This parameter is always required.
-
-.TP
-.B login
-.
-Login Name This parameter is always required.
-
-.TP
-.B passwd
-.
-Login password or passphrase
-
-.TP
-.B passwd_script
-.
-Script to retrieve password
-
-.TP
-.B ssl
-.
-SSL connection
-
-.TP
-.B inet4_only
-.
-Forces agent to use IPv4 addresses only
-
-.TP
-.B inet6_only
-.
-Forces agent to use IPv6 addresses only
-
-.TP
-.B ipport
-.
-TCP port to use for connection with device
-
-.TP
-.B port
-.
-Physical plug number or name of virtual machine This parameter is always required.
-
-.TP
-.B verbose
-.
-Verbose mode
-
-.TP
-.B debug
-.
-Write debug information to given file
-
-.TP
-.B version
-.
-Display version information and exit
-
-.TP
-.B help
-.
-Display help and exit
-
-.TP
-.B separator
-.
-Separator for CSV created by operation list (Default Value: ,)
-
-.TP
-.B power_wait
-.
-Wait X seconds after issuing ON/OFF (Default Value: 0)
-
-.TP
-.B power_timeout
-.
-Test X seconds for status change after ON/OFF (Default Value: 20)
-
-.TP
-.B shell_timeout
-.
-Wait X seconds for cmd prompt after issuing command (Default Value: 3)
-
-.TP
-.B retry_on
-.
-Count of attempts to retry power on (Default Value: 1)
-
-.TP
-.B delay
-.
-Wait X seconds before fencing is started (Default Value: 0)
diff --git a/fence/man/fence_eps.8 b/fence/man/fence_eps.8
deleted file mode 100644
index 3685837..0000000
--- a/fence/man/fence_eps.8
+++ /dev/null
@@ -1,106 +0,0 @@
-.TH fence_eps 8
-
-.SH NAME
-fence_eps - I/O Fencing agent for ePowerSwitch 8M+ power switch
-
-.SH SYNOPSIS
-.B
-fence_eps
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_eps is an I/O Fencing agent which can be used with the ePowerSwitch 8M+ power
-switch to fence connected machines. Fence agent works (in 2008/10/21) ONLY on 8M+
-device, because this is only one, which has support for hidden page feature.
-
-Agent basically works by connecting to hidden page and pass appropriate arguments
-to GET request. This means, that hidden page feature must be enabled and properly
-configured.
-
-fence_eps accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_eps
-can be run by itself with command line options. This is useful for testin
-and for turning outlets on or off from scripts.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of ePowerSwitch 8M+ device. If device is configured
-to listen on nonstandard port (other than 80), it's possible to use :port syntax
-(ex. psip:8080).
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-o\fP \fIaction\fR
-The action required. This can be reboot (default), status, off or on.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login.
-.TP
-\fB-S\fP \fIscript\fR
-Script to run to retrieve password.
-.TP
-\fB-n\fP \fIname\fR
-Physical plug number. Entered without P and with preceding zero (where is needed).
-.TP
-\fB-c\fP \fIname\fR
-Name of hidden page. Default is (hidden.htm)
-.TP
-\fB-T\fP
-Test only. Answer NO to the confirmation prompt instead of YES.
-.TP
-\fB-q\fP
-Quiet mode.
-.TP
-\fB-v\fP
-Verbose. Record session to stdout, or debug file if specified (see -D).
-.TP
-\fB-D\fP
-Specifies file, where will be written debug messages from session.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_eps.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of ePowerSwitch 8M+ device. If device is configured
-to listen on nonstandard port (other than 80), it's possible to use :port syntax
-(ex. psip:8080).
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. This can be reboot (default), status, off or on.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Script to run to retrieve password.
-.TP
-\fIport = < param >\fR
-Physical plug number. Entered without P and with preceding zero (where is needed)
-.TP
-\fIhidden_page = < param >\fR
-Name of hidden page. Default is (hidden.htm)
-.TP
-\fItest = < param >\fR
-Test only. Answer NO to the confirmation prompt instead of YES.
-.TP
-\fIverbose = < param >\fR
-Verbose. Record session to stdout, or debug file if specified (see debug).
-.TP
-\fIdebug = < param >\fR
-Specifies file, where will be written debug messages from session.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/man/fence_ibmblade.8 b/fence/man/fence_ibmblade.8
deleted file mode 100644
index 5d1b1ba..0000000
--- a/fence/man/fence_ibmblade.8
+++ /dev/null
@@ -1,68 +0,0 @@
-.\" Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-.\" Copyright (C) 2004 Red Hat, Inc. All rights reserved.
-.\"
-.\" This copyrighted material is made available to anyone wishing to use,
-.\" modify, copy, or redistribute it subject to the terms and conditions
-.\" of the GNU General Public License v.2.
-
-.TH fence_ibmblade 8
-
-.SH NAME
-fence_ibmblade - I/O Fencing agent for IBM BladeCenter
-
-.SH SYNOPSIS
-.B
-fence_ibmblade
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_ibmblade is an I/O Fencing agent which can be used with IBM BladeCenter
-chassis. It issues SNMP Set request to BladeCenter chassins, rebooting, powering
-up or down the specified Blade Server.
-
-fence_ibmblade accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_ibmblade
-can be run by itself with command line options which is useful for testing.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the BladeCenter chassis.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-c\fP \fIcommunity\fP
-SNMP community string to use.
-.TP
-\fB-n\fP \fIport\fP
-The Blade port number to disable.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. Reboot (default), On or off.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_ibmblade.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIcommunity = < param >\fR
-SNMP community.
-.TP
-\fIoption = < param >\fR
-The action required. reboot (default), on or off.
-.TP
-\fIport = < param >\fR
-The Blade port number to disable.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/man/fence_ifmib.8 b/fence/man/fence_ifmib.8
deleted file mode 100644
index 914d43a..0000000
--- a/fence/man/fence_ifmib.8
+++ /dev/null
@@ -1,323 +0,0 @@
-
-.TH FENCE_AGENT 8 2009-10-20 "fence_ifmib (Fence Agent)"
-.SH NAME
-fence_ifmib - Fence agent for IF MIB
-.SH DESCRIPTION
-.P
-fence_ifmib is an I/O Fencing agent which can be used with any SNMP IF-MIB capable device.
-.P
-It was written with managed ethernet switches in mind, in order to fence iSCSI SAN connections. However, there are many devices that support the IF-MIB interface. The agent uses IF-MIB::ifAdminStatus to control the state of an interface.
-.P
-fence_ifmib accepts options on the command line as well
-as from stdin. Fenced sends parameters through stdin when it execs the
-agent. fence_ifmib can be run by itself with command
-line options. This is useful for testing and for turning outlets on or off
-from scripts.
-
-Vendor URL: http://www.ietf.org/wg/concluded/ifmib.html
-.SH PARAMETERS
-
-
-.TP
-.B -o, --action=<action>
-.
-Fencing Action (Default Value: reboot)
-
-.TP
-.B -a, --ip=<ip>
-.
-IP Address or Hostname This parameter is always required.
-
-.TP
-.B -l, --username=<name>
-.
-Login Name
-
-.TP
-.B -p, --password=<password>
-.
-Login password or passphrase
-
-.TP
-.B -S, --password-script=<script>
-.
-Script to retrieve password
-
-.TP
-.B -n, --plug=<id>
-.
-Physical plug number or name of virtual machine This parameter is always required.
-
-.TP
-.B -d, --snmp-version=<ver>
-.
-Specifies SNMP version to use (1,2c,3)
-
-.TP
-.B -c, --community=<community>
-.
-Set the community string
-
-.TP
-.B -b, --snmp-auth-prot=<prot>
-.
-Set authentication protocol (MD5|SHA)
-
-.TP
-.B -E, --snmp-sec-level=<level>
-.
-Set security level (noAuthNoPriv|authNoPriv|authPriv)
-
-.TP
-.B -B, --snmp-priv-prot=<prot>
-.
-Set privacy protocol (DES|AES)
-
-.TP
-.B -P, --snmp-priv-passwd=<pass>
-.
-Set privacy protocol password
-
-.TP
-.B -R, --snmp-priv-passwd-script
-.
-Script to run to retrieve privacy password
-
-.TP
-.B -u, --udpport
-.
-UDP/TCP port to use for connection with device (Default Value: 161)
-
-.TP
-.B -4, --inet4-only
-.
-Forces agent to use IPv4 addresses only
-
-.TP
-.B -6, --inet6-only
-.
-Forces agent to use IPv6 addresses only
-
-.TP
-.B -v, --verbose
-.
-Verbose mode
-
-.TP
-.B -D, --debug-file=<debugfile>
-.
-Write debug information to given file
-
-.TP
-.B -V, --version
-.
-Display version information and exit
-
-.TP
-.B -h, --help
-.
-Display help and exit
-
-.TP
-.B -C, --separator=<char>
-.
-Separator for CSV created by operation list (Default Value: ,)
-
-.TP
-.B --power-timeout
-.
-Test X seconds for status change after ON/OFF (Default Value: 20)
-
-.TP
-.B --shell-timeout
-.
-Wait X seconds for cmd prompt after issuing command (Default Value: 3)
-
-.TP
-.B --login-timeout
-.
-Wait X seconds for cmd prompt after login (Default Value: 5)
-
-.TP
-.B --power-wait
-.
-Wait X seconds after issuing ON/OFF (Default Value: 0)
-
-.TP
-.B --retry-on
-.
-Count of attempts to retry power on (Default Value: 1)
-
-.TP
-.B --delay
-.
-Wait X seconds before fencing is started (Default Value: 0)
-
-.SH ACTIONS
-
-
-.TP
-\fBon \fP
-Power on machine.
-
-.TP
-\fBoff \fP
-Power off machine.
-
-.TP
-\fBreboot \fP
-Reboot machine.
-
-.TP
-\fBstatus \fP
-This returns the status of the plug/virtual machine.
-
-.TP
-\fBlist \fP
-List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise.
-
-.TP
-\fBmonitor \fP
-Check if fencing device is running. List available plugs/virtual machines or get status of machine (if it does not support more).
-
-.TP
-\fBmetadata \fP
- The operational behavior of this is not known.
-
-.SH STDIN PARAMETERS
-
-
-.TP
-.B action
-.
-Fencing Action (Default Value: reboot)
-
-.TP
-.B ipaddr
-.
-IP Address or Hostname This parameter is always required.
-
-.TP
-.B login
-.
-Login Name
-
-.TP
-.B passwd
-.
-Login password or passphrase
-
-.TP
-.B passwd_script
-.
-Script to retrieve password
-
-.TP
-.B port
-.
-Physical plug number or name of virtual machine This parameter is always required.
-
-.TP
-.B snmp_version
-.
-Specifies SNMP version to use (1,2c,3)
-
-.TP
-.B community
-.
-Set the community string
-
-.TP
-.B snmp_auth_prot
-.
-Set authentication protocol (MD5|SHA)
-
-.TP
-.B snmp_sec_level
-.
-Set security level (noAuthNoPriv|authNoPriv|authPriv)
-
-.TP
-.B snmp_priv_prot
-.
-Set privacy protocol (DES|AES)
-
-.TP
-.B snmp_priv_passwd
-.
-Set privacy protocol password
-
-.TP
-.B snmp_priv_passwd_script
-.
-Script to run to retrieve privacy password
-
-.TP
-.B udpport
-.
-UDP/TCP port to use for connection with device (Default Value: 161)
-
-.TP
-.B inet4_only
-.
-Forces agent to use IPv4 addresses only
-
-.TP
-.B inet6_only
-.
-Forces agent to use IPv6 addresses only
-
-.TP
-.B verbose
-.
-Verbose mode
-
-.TP
-.B debug
-.
-Write debug information to given file
-
-.TP
-.B version
-.
-Display version information and exit
-
-.TP
-.B help
-.
-Display help and exit
-
-.TP
-.B separator
-.
-Separator for CSV created by operation list (Default Value: ,)
-
-.TP
-.B power_timeout
-.
-Test X seconds for status change after ON/OFF (Default Value: 20)
-
-.TP
-.B shell_timeout
-.
-Wait X seconds for cmd prompt after issuing command (Default Value: 3)
-
-.TP
-.B login_timeout
-.
-Wait X seconds for cmd prompt after login (Default Value: 5)
-
-.TP
-.B power_wait
-.
-Wait X seconds after issuing ON/OFF (Default Value: 0)
-
-.TP
-.B retry_on
-.
-Count of attempts to retry power on (Default Value: 1)
-
-.TP
-.B delay
-.
-Wait X seconds before fencing is started (Default Value: 0)
diff --git a/fence/man/fence_ilo.8 b/fence/man/fence_ilo.8
deleted file mode 100644
index a2dd038..0000000
--- a/fence/man/fence_ilo.8
+++ /dev/null
@@ -1,95 +0,0 @@
-.\" Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-.\" Copyright (C) 2004 Red Hat, Inc. All rights reserved.
-.\"
-.\" This copyrighted material is made available to anyone wishing to use,
-.\" modify, copy, or redistribute it subject to the terms and conditions
-.\" of the GNU General Public License v.2.
-
-.TH fence_ilo 8
-
-.SH NAME
-fence_ilo - I/O Fencing agent for HP Integrated Lights Out card
-
-.SH SYNOPSIS
-.B
-fence_ilo
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_ilo is an I/O Fencing agent used for HP servers with the Integrated Light
-Out (iLO) PCI card. The agent opens an SSL connection to the iLO card. Once the
-SSL connection is established, the agent is able to communicate with the iLO
-card through an XML stream.
-
-fence_ilo depends on the pyOpenSSL available in your distribution or
-downloadable from http://pyopenssl.sourceforge.net
-
-NOTE: fence_ilo deprecates fence_rib.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress[:port]\fR
-IP address or hostname of the iLO card. If the SSL server of the card is
-not running on the default SSL port, 443, then [:port] will also need to be
-specified.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-o\fP \fIaction\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login or for passphrase.
-.TP
-\fB-S\fP \fIscript\fR
-Script to run to retrieve password.
-\fB-z\fP
-Use secure connection over SSL (default).
-.TP
-\fB-r\fP \fIprotocol\fR
-RIBCL protocol to use. Default is to autodetect.
-.TP
-\fB-v\fP
-Verbose.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIaction = < param >\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_ilo.
-.TP
-\fIhostname = < hostname | ip >\fR
-IP address or hostname of the iLO card.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIpasswd = < param >\fR
-Password for login or for passphrase.
-.TP
-\fIpasswd_script = < param >\fR
-Script to run to retrieve password.
-.TP
-\fIssl = < param >\fR
-Use secure connection over SSL.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIribcl = < param >\fR
-RIBCL protocol to use. Default is to autodetect.
-.TP
-\fIverbose = < param >\fR
-Verbose mode.
-
-.SH SEE ALSO
-fence(8), fence_node(8), fence_rib(8)
diff --git a/fence/man/fence_ipmilan.8 b/fence/man/fence_ipmilan.8
deleted file mode 100644
index 9b10198..0000000
--- a/fence/man/fence_ipmilan.8
+++ /dev/null
@@ -1,111 +0,0 @@
-.\" Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-.\" Copyright (C) 2004 Red Hat, Inc. All rights reserved.
-.\"
-.\" This copyrighted material is made available to anyone wishing to use,
-.\" modify, copy, or redistribute it subject to the terms and conditions
-.\" of the GNU General Public License v.2.
-
-.TH fence_ipmilan 8
-
-.SH NAME
-fence_ipmilan - I/O Fencing agent for machines controlled by IPMI over
-LAN.
-
-.SH SYNOPSIS
-.B
-fence_ipmilan
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_ipmilan is an I/O Fencing agent which can be used with
-machines controlled by IPMI. This agent calls support software
-using ipmitool (http://ipmitool.sf.net/).
-
-fence_ipmilan accepts options on the command line as well as from stdin.
-fenced sends the options through stdin when it execs the agent. fence_ipmilan
-can be run by itself with command line options which is useful for testing.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address or hostname of the IPMI controller.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login (if required) with administrative privileges.
-.TP
-\fB-o\fP \fIoption\fP
-Action to perform (on, off, reboot).
-.TP
-\fB-p\fP \fIpassword\fP
-Password (if required) for login.
-.TP
-\fB-P\fP
-Use the lanplus option if this is a lanplus capable interface (for example iLo2)
-.TP
-\fB-A\fP \fIAuthentication Type\fP
-Can be set to none, password, md2, or md5.
-.TP
-\fB-C\fP \fICiphersuite Type\fP
-If you are using lanplus, this option avails you to define type of ciphersuite to
-use. Standard is 3 (defined if you just use lanplus). For more information please
-refer ipmitool man page (option -C).
-.TP
-\fB-M\fP \fImethod\fP
-Method to fence (onoff or cycle). Default is onoff. Use cycle in case your management
-card will power off with default method so there will be no chance to power machine
-on by IPMI.
-.TP
-\fB-t\fP \fItimeout\fP
-Timeout in seconds for IPMI operation. Default is 10, but in some cases it
-must be set to higher value (anything above 30 is not recommended and may
-cause strange problems).
-.TP
-\fB-q\fP
-Quiet operation. Only print out error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-.TP
-\fB-v\fP
-Verbose mode.
-
-.SH STDIN PARAMETERS
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the IPMI controller.
-.TP
-\fIlogin= < param >\fR
-Login (if required) with administrative privileges.
-.TP
-\fIoption = < param >\fR
-Action to perform (on, off, reboot).
-.TP
-\fIpasswd = < param >\fR
-Password (if required) for login.
-.TP
-\fIauth = < param >\fR
-Authentication type (none, password, md2, md5).
-.TP
-\fItimeout = < param >\fR
-Timeout in seconds for IPMI operation. Default is 10, but in some cases it
-must be set to higher value (anything above 30 is not recommended and may
-cause strange problems).
-.TP
-\fIcipher = < param >\fR
-If you are using lanplus, this option avails you to define type of ciphersuite to
-use. Standard is 3 (defined if you just use lanplus). For more information please
-refer ipmitool man page (option -C).
-.TP
-\fImethod = < param >\fR
-Method to fence (onoff or cycle). Default is onoff. Use cycle in case your management
-card will power off with default method so there will be no chance to power machine
-on by IPMI.
-.TP
-\fIlanplus\fR
-If we are using the lanplus option for ipmitool
-
-.SH SEE ALSO
-fence(8), fence_node(8), ipmitool(1)
diff --git a/fence/man/fence_lpar.8 b/fence/man/fence_lpar.8
deleted file mode 100644
index b4de871..0000000
--- a/fence/man/fence_lpar.8
+++ /dev/null
@@ -1,116 +0,0 @@
-.\" Copyright (C) 2009 Red Hat, Inc. All rights reserved.
-.\"
-.\" This copyrighted material is made available to anyone wishing to use,
-.\" modify, copy, or redistribute it subject to the terms and conditions
-.\" of the GNU General Public License v.2.
-
-.TH fence_lpar 8
-
-.SH NAME
-fence_lpar - I/O Fencing agent for IBM Power Systems
-
-.SH SYNOPSIS
-.B
-fence_lpar
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_lpar is an I/O Fencing agent which can be used with IBM Power Systems.
-It logs into the HMC via ssh and uses the command line interface to operate
-LPARs.
-
-fence_lpar accepts options on the command line as well as from stdin. Fenced
-sends parameters through stdin when it execs the agent. fence_lpar can be run
-by itself with command line options. This is useful for testing and for
-stopping and starting LPARs from scripts.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of the HMC.
-.TP
-\fB-c\fP \fIprompt\fR
-Select command prompt. Default: :~>, ]
-.TP
-\fB-D\fP \fIdebugfile\fR
-Write debug information to given file.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-H\fP \fIversion\fR
-Select an HMC version to use: 3 or 4 (default).
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-n\fP \fIname\fR
-Partition name.
-.TP
-\fB-o\fP \fIaction\fR
-The action required. Reboot (default), Status, Off or On.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login.
-.TP
-\fB-s\fP \fIname\fR
-Managed system name.
-.TP
-\fB-S\fP \fIscript\fR
-Script to run to retrieve password.
-.TP
-\fB-x\fP
-Use secure connection over ssh.
-.TP
-\fB-v\fP
-Verbose mode.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIaction = < param >\fR
-The fencing action requested: reboot (default), on, off or status.
-.TP
-\fIcmd_prompt = < param >\fR
-Force command prompt. Default: :~>, ]
-.TP
-\fIdebug = < param >\fR
-Write debug information to given file.
-.TP
-\fIhelp = < param >\fR
-Display help and exit.
-.TP
-\fIhmc_version = < param >\fR
-HMC version to use: 3 or 4 (default).
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the HMC.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fImanaged = < param >\fR
-Managed system name.
-.TP
-\fIpartition = < param >\fR
-Partition name.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Script to run to retrieve password.
-.TP
-\fIsecure\fR
-Use secure connection over ssh.
-.TP
-\fIverbose\fR
-Verbose mode.
-.TP
-\fIversion\fR
-Display version information and exit.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/man/fence_rsa.8 b/fence/man/fence_rsa.8
deleted file mode 100644
index 0ba1744..0000000
--- a/fence/man/fence_rsa.8
+++ /dev/null
@@ -1,69 +0,0 @@
-.\" Copyright (C) 2006 Red Hat, Inc. All rights reserved.
-.\"
-.\" This copyrighted material is made available to anyone wishing to use,
-.\" modify, copy, or redistribute it subject to the terms and conditions
-.\" of the GNU General Public License v.2.
-
-.TH fence_rsa 8
-
-.SH NAME
-fence_rsa - I/O Fencing agent for IBM RSA II
-
-.SH SYNOPSIS
-.B
-fence_rsa
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_rsa is an I/O Fencing agent which can be used with the IBM RSA II
-management interface. It logs into an RSA II device via telnet and reboots
-the associated machine. Lengthy telnet connections to the RSA II device
-should be avoided while a GFS cluster is running because the connection
-will block any necessary fencing actions.
-
-fence_rsa accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_rsa
-can be run by itself with command line options. This is useful for testing.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of the RSA II device.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-o\fP \fIaction\fR
-The action required. Reboot (default), Off, On, or Status.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login.
-.TP
-\fB-v\fP
-Verbose. Print informational messages to standard out.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_rsa.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the device.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. Reboot (default), Off, On or Status.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/man/fence_sanbox2.8 b/fence/man/fence_sanbox2.8
deleted file mode 100644
index 46209f8..0000000
--- a/fence/man/fence_sanbox2.8
+++ /dev/null
@@ -1,83 +0,0 @@
-.\" Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-.\" Copyright (C) 2004 Red Hat, Inc. All rights reserved.
-.\"
-.\" This copyrighted material is made available to anyone wishing to use,
-.\" modify, copy, or redistribute it subject to the terms and conditions
-.\" of the GNU General Public License v.2.
-
-.TH fence_sanbox2 8
-
-.SH NAME
-fence_sanbox2 - I/O Fencing agent for QLogic SANBox2 FC switches
-
-.SH SYNOPSIS
-.B
-fence_sanbox2
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_sanbox2 is an I/O Fencing agent which can be used with QLogic SANBox2 FC
-switches. It logs into a SANBox2 switch via telnet and disables a specified
-port. Disabling the port which a machine is connected to effectively fences
-that machine. Lengthy telnet connections to the switch should be avoided
-while a GFS cluster is running because the connection will block any necessary
-fencing actions.
-
-fence_sanbox2 accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_sanbox2
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer connect
-to the switch. When the fenced machine is ready to be brought back
-into the GFS cluster (after reboot) the port on the FC switch needs to
-be enabled. This can be done by running fence_sanbox2 and specifying the
-enable action.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The port number to disable on the switch.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. disable (default) or enable.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_sanbox2.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. disable (default) or enable.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIport = < param >\fR
-The port number to disable on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/man/fence_vmware.8 b/fence/man/fence_vmware.8
deleted file mode 100644
index 31ea5f8..0000000
--- a/fence/man/fence_vmware.8
+++ /dev/null
@@ -1,137 +0,0 @@
-.\" Copyright (C) 2008 Red Hat, Inc. All rights reserved.
-.\"
-.\" This copyrighted material is made available to anyone wishing to use,
-.\" modify, copy, or redistribute it subject to the terms and conditions
-.\" of the GNU General Public License v.2.
-
-.TH fence_vmware 8
-
-.SH NAME
-fence_vmware - I/O Fencing agent for VMware virtual machines
-
-.SH SYNOPSIS
-.B
-fence_vmware
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_vmware is an I/O Fencing agent which can be used with the VMware ESX or
-VMware Server to fence virtual machines. It logs via ssh to a VMware ESX (or Server)
-physical machine and there run vmware-cmd, which does all work.
-
-By default, VMware ESX has disabled root account so you must create annother user
-account with limited permissions on VMWare ESX machine.
-
-Better idea is install right version of vmware-cmd (with same API) to any other machine
-in network and use it for fencing.
-
-fence_vmware accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_vmware
-can be run by itself with command line options. This is useful for testing
-and for turning outlets on or off from scripts.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of machine where is vmware-cmd.
-.TP
-\fB-A\fP \fIIPAdress\fR
-IP adress or hostname of machine where is runing vmware. Default is localhost.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name of machine with vmware-cmd.
-.TP
-\fB-L\fP \fIlogin\fR
-Login name to VMware administration interface.
-.TP
-\fB-o\fP \fIaction\fR
-The action required. Reboot (default), Status, Off or On.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login or for passphrase for machine with vmware-cmd.
-.TP
-\fB-P\fP \fIpassword\fR
-Password for login to VMware administration interface.
-.TP
-\fB-B\fP \fIscript\fR
-Script to run to retrieve password for machine with vmware-cmd.
-.TP
-\fB-R\fP \fIscript\fR
-Script to run to retrieve password for VMware administration interface.
-.TP
-\fB-n\fP \fIname\fR
-Name of virtual machine to fence (ie. /vmfs/volumes/48bfcbd1-4624461c-8250-0015c5f3ef0f/Rhel/Rhel.vmx)
-.TP
-\fB-x\fP
-Use secure connection over ssh (this is default, and can't be disabled)
-.TP
-\fB-k\fP \fIfilename\fR
-Identity file (private key) for ssh
-.TP
-\fB-T\fP
-Test only. Answer NO to the confirmation prompt instead of YES.
-.TP
-\fB-v\fP
-Verbose. Record session to stdout, or debug file if specified (see -D).
-.TP
-\fB-D\fP
-Specifies file, where will be written debug messages from session.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_vmware.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of machine where is vmware-cmd.
-.TP
-\fIvmipaddr = < hostname | ip >\fR
-IP adress or hostname of machine where is runing vmware. Default is localhost.
-.TP
-\fIlogin = < param >\fR
-Login name of machine with vmware-cmd.
-.TP
-\fIvmlogin = < param >\fR
-Login name to VMware administration interface.
-.TP
-\fIoption = < param >\fR
-The action required. Reboot (default), Off or On.
-.TP
-\fIpasswd = < param >\fR
-Password for login or for passphrase for machine with vmware-cmd.
-.TP
-\fIvmpasswd = < param >\fR
-Password for login to VMware administration interface.
-.TP
-\fIpasswd_script = < param >\fR
-Script to run to retrieve password for machine with vmware-cmd.
-.TP
-\fIvmpasswd_script = < param >\fR
-Script to run to retrieve password for VMware administration interface.
-.TP
-\fIport = < param >\fR
-Name of virtual machine to fence (ie. /vmfs/volumes/48bfcbd1-4624461c-8250-0015c5f3ef0f/Rhel/Rhel.vmx)
-.TP
-\fIsecure = < param >\fR
-Use secure connection over ssh (this is default, and can't be disabled)
-.TP
-\fIidentity_file = < param >\fR
-Identity file (private key) for ssh
-.TP
-\fItest = < param >\fR
-Test only. Answer NO to the confirmation prompt instead of YES.
-.TP
-\fIverbose = < param >\fR
-Verbose. Record session to stdout, or debug file if specified (see debug).
-.TP
-\fIdebug = < param >\fR
-Specifies file, where will be written debug messages from session.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/man/fence_wti.8 b/fence/man/fence_wti.8
deleted file mode 100644
index 1b1d231..0000000
--- a/fence/man/fence_wti.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.\" Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-.\" Copyright (C) 2004 Red Hat, Inc. All rights reserved.
-.\"
-.\" This copyrighted material is made available to anyone wishing to use,
-.\" modify, copy, or redistribute it subject to the terms and conditions
-.\" of the GNU General Public License v.2.
-
-.TH fence_wti 8
-
-.SH NAME
-fence_wti - I/O Fencing agent for WTI Network Power Switch
-
-.SH SYNOPSIS
-.B
-fence_wti
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_wti is an I/O Fencing agent which can be used with the WTI Network
-Power Switch (NPS). It logs into an NPS via telnet or ssh and boots a specified plug.
-Lengthy telnet connections to the NPS should be avoided while a GFS cluster is
-running because the connection will block any necessary fencing actions.
-
-fence_wti accepts options on the command line as well as from stdin.
-fenced sends the options through stdin when it execs the agent. fence_wti
-can be run by itself with command line options which is useful for testing.
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fIplug\fP
-The plug number to power cycle.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login or for passphrase.
-.TP
-\fB-S\fP \fIscript\fR
-Script to run to retrieve password.
-.TP
-\fB-x\fP
-Use secure connection over ssh.
-.TP
-\fB-T\fP
-Test only. Do not power cycle. Reports state of the plug.
-.TP
-\fB-q\fP
-Quiet operation. Only print out error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_wti.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIpasswd = < param >\fR
-Password for login or for passphrase.
-.TP
-\fIpasswd_script = < param >\fR
-Script to run to retrieve password.
-.TP
-\fIidentity_file = < param > \fR
-Identity file (private key) for ssh.
-.TP
-\fIsecure = < param >\fR
-Use secure connection over ssh.
-.TP
-\fIport = < param >\fR
-The outlet number to act upon.
-.TP
-\fItest = < param >\fR
-Test only. Answer NO to the confirmation prompt instead of YES.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: 5bee71f95ec9f1c6a1486fe7f16ddeda32865b1d
Parent: 693d93c73fb6cd4a7978a507f0fce33c85feda6f
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Fri Feb 25 09:46:34 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Fri Feb 25 09:46:34 2011 +0100
fence_eaton_snmp: fix port number handling
snmp port enumration starts at 0 while all other interfaces start at 1.
Make the numbering consistent between configuration, devices and UIs.
Signed-off-by: Arnaud Quette <aquette.dev(a)gmail.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
fence/agents/eaton_snmp/fence_eaton_snmp.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/fence/agents/eaton_snmp/fence_eaton_snmp.py b/fence/agents/eaton_snmp/fence_eaton_snmp.py
index b02cfd1..18df1cb 100644
--- a/fence/agents/eaton_snmp/fence_eaton_snmp.py
+++ b/fence/agents/eaton_snmp/fence_eaton_snmp.py
@@ -160,6 +160,11 @@ def main():
if (not (options.has_key("-s"))):
options["-s"]="1"
+ # Plug indexing start from zero, so we substract '1' from the
+ # user's given plug number
+ if ((options.has_key("-n")) and (options["-n"].isdigit())):
+ options["-n"] = str(int(options["-n"]) - 1)
+
docs = { }
docs["shortdesc"] = "Fence agent for Eaton over SNMP"
docs["longdesc"] = "fence_eaton_snmp is an I/O Fencing agent \
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: ffda3929ec66f086f91adc69682285127693f137
Parent: 0000000000000000000000000000000000000000
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: 2011-02-23 15:23 +0000
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: 2011-02-23 15:23 +0000
annotated tag: 3.1.1 has been created
at ffda3929ec66f086f91adc69682285127693f137 (tag)
tagging 4a727917ff403b6f386c992d1e071e3f1a795893 (commit)
replaces 3.1.0
New tag for updated source tree
Benjamin Marzinski (1):
gfs2_grow: fix growing on full filesystems
Bob Peterson (14):
mkfs.gfs2 should support discard request generation
GFS2: mkfs.gfs2 segfaults with 18.55TB and -b512
gfs2-utils: minor corrections to README.build
fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap
fsck.gfs2: can't repair rgrps resulting from gfs_grow->gfs2_convert
gfs2_edit: handle corrupt file systems better
gfs2_edit: print large block numbers better
gfs2_edit: has problems printing gfs1 journals
gfs2_edit: add -d option for printing journal details
gfs2_edit: Fix error message on blockalloc when outside bitmap
gfs2_edit: fix careless compiler warning
gfs2_edit: fix segfault in set_bitmap when block is in rgrp
fsck.gfs2: segfault in pass1b
gfs2_edit savemeta doesn't save all leaf blocks for large dirs
David Teigland (1):
gfs_controld: remove oom_adj
Steven Whitehouse (5):
tune: Clean up and make closer to tune2fs
strings: Clean up strings
libgfs2: Remove calls to gettext from libgfs2
libgfs2: Remove unused function get_sysfs_uinit()
libgfs2: Move gfs2_query into gfs2_convert
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: 4a727917ff403b6f386c992d1e071e3f1a795893
Parent: 4e79f08f455038bdfb962f941676b7d5d8c21ef8
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed Feb 23 07:13:31 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Feb 23 07:13:31 2011 -0600
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 | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 666a452..844da8c 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -398,10 +398,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 */
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=b9…
Commit: b9306e19ba3f346326befd933c8ecdd9bc8973bf
Parent: 415fc5f19db6780c76dfc00f680a9617dacd7b31
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Tue Feb 22 16:40:37 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Tue Feb 22 16:40:37 2011 -0600
fsck.gfs2: segfault in pass1b
The problem occurred when there were duplicate block
references in a dinode but all references in the duplicate
list are eventually deleted due to other corruption.
The fix is an additional check whether the list is empty.
rhbz#679076
---
gfs2/fsck/pass1b.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index a0c5c88..9abc8c1 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -558,7 +558,7 @@ static int handle_dup_blk(struct gfs2_sbd *sbp, struct duptree *b)
last_reference = clear_a_reference(sbp, b, &b->ref_inode_list,
&dh, 0);
- if (last_reference) {
+ if (last_reference && !osi_list_empty(&b->ref_inode_list)) {
uint8_t q;
/* If we're down to a single reference (and not all references
Gitweb: http://git.fedorahosted.org/git/fence.git?p=fence.git;a=commitdiff;h=73c0f5…
Commit: 73c0f58f071d713bd3b634ffcfb1d02feba84fcc
Parent: 7181608a3a497bff3d9d1306e77503dbfc4c32f5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Feb 22 15:47:24 2011 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Feb 22 16:40:30 2011 -0600
fenced: don't ignore victim_done messages for reduced victims
When a victim is "reduced" (i.e. fenced skips fencing it because it
rejoins the cluster cleanly before fenced fences it), it is immediately
removed from the list of victims, before the "victim_done" message is
sent for it. The victim_done message updates the time of the last
successful fencing operation for a failed node.
The code that processes received victim_done messages was ignoring the
message for the reduced victim because the node couldn't be found in
the victims list. This caused the latest fencing information to not be
recorded for the node, causing dlm_controld to wait indefinately for
fencing to complete for the reduced victim.
The fix is to simply record the information from a victim_done message
even if the node is not in the victims list.
bz 678704
Acked-by: Ryan O'Hara <rohara(a)redhat.com>
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
fence/fenced/cpg.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/fence/fenced/cpg.c b/fence/fenced/cpg.c
index eec2ba6..716d4c4 100644
--- a/fence/fenced/cpg.c
+++ b/fence/fenced/cpg.c
@@ -654,9 +654,9 @@ static void receive_victim_done(struct fd *fd, struct fd_header *hd, int len)
node = get_node_victim(fd, id->nodeid);
if (!node) {
+ /* see comment below about no node */
log_debug("receive_victim_done %d:%u no victim nodeid %d",
hd->nodeid, seq, id->nodeid);
- return;
}
log_debug("receive_victim_done %d:%u remove victim %d time %llu how %d",
@@ -672,9 +672,11 @@ static void receive_victim_done(struct fd *fd, struct fd_header *hd, int len)
if (hd->nodeid == our_nodeid) {
/* sanity check, I don't think this should happen;
see comment in fence_victims() */
- if (!node->local_victim_done)
- log_error("expect local_victim_done");
- node->local_victim_done = 0;
+ if (node) {
+ if (!node->local_victim_done)
+ log_error("expect local_victim_done");
+ node->local_victim_done = 0;
+ }
} else {
/* save details of fencing operation from master, which
master saves at the time it completes it */
@@ -682,8 +684,12 @@ static void receive_victim_done(struct fd *fd, struct fd_header *hd, int len)
id->fence_how, id->fence_time);
}
- list_del(&node->list);
- free(node);
+ /* we can have no node when reduce_victims() removes it, bz 678704 */
+
+ if (node) {
+ list_del(&node->list);
+ free(node);
+ }
}
/* we know that the quorum value here is consistent with the cpg events
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=09…
Commit: 0901934fdcd49f85deac905da3d63497d3885382
Parent: c217c686b16f9aa8be3b2b49d017b11bf05b26fc
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Feb 22 15:47:24 2011 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Feb 22 16:39:53 2011 -0600
fenced: don't ignore victim_done messages for reduced victims
When a victim is "reduced" (i.e. fenced skips fencing it because it
rejoins the cluster cleanly before fenced fences it), it is immediately
removed from the list of victims, before the "victim_done" message is
sent for it. The victim_done message updates the time of the last
successful fencing operation for a failed node.
The code that processes received victim_done messages was ignoring the
message for the reduced victim because the node couldn't be found in
the victims list. This caused the latest fencing information to not be
recorded for the node, causing dlm_controld to wait indefinately for
fencing to complete for the reduced victim.
The fix is to simply record the information from a victim_done message
even if the node is not in the victims list.
bz 678704
Acked-by: Ryan O'Hara <rohara(a)redhat.com>
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
fence/fenced/cpg.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/fence/fenced/cpg.c b/fence/fenced/cpg.c
index a8629b9..99e16a0 100644
--- a/fence/fenced/cpg.c
+++ b/fence/fenced/cpg.c
@@ -652,9 +652,9 @@ static void receive_victim_done(struct fd *fd, struct fd_header *hd, int len)
node = get_node_victim(fd, id->nodeid);
if (!node) {
+ /* see comment below about no node */
log_debug("receive_victim_done %d:%u no victim nodeid %d",
hd->nodeid, seq, id->nodeid);
- return;
}
log_debug("receive_victim_done %d:%u remove victim %d time %llu how %d",
@@ -670,9 +670,11 @@ static void receive_victim_done(struct fd *fd, struct fd_header *hd, int len)
if (hd->nodeid == our_nodeid) {
/* sanity check, I don't think this should happen;
see comment in fence_victims() */
- if (!node->local_victim_done)
- log_error("expect local_victim_done");
- node->local_victim_done = 0;
+ if (node) {
+ if (!node->local_victim_done)
+ log_error("expect local_victim_done");
+ node->local_victim_done = 0;
+ }
} else {
/* save details of fencing operation from master, which
master saves at the time it completes it */
@@ -680,8 +682,12 @@ static void receive_victim_done(struct fd *fd, struct fd_header *hd, int len)
id->fence_how, id->fence_time);
}
- list_del(&node->list);
- free(node);
+ /* we can have no node when reduce_victims() removes it, bz 678704 */
+
+ if (node) {
+ list_del(&node->list);
+ free(node);
+ }
}
/* we know that the quorum value here is consistent with the cpg events
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4e…
Commit: 4eb20ad9f8e62d0739c7897d79bc1bccb94e5250
Parent: 8fd8d3f3c52b9efc09d911bd8fdcab3e8742e9cb
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Feb 22 15:47:24 2011 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Feb 22 16:33:11 2011 -0600
fenced: don't ignore victim_done messages for reduced victims
When a victim is "reduced" (i.e. fenced skips fencing it because it
rejoins the cluster cleanly before fenced fences it), it is immediately
removed from the list of victims, before the "victim_done" message is
sent for it. The victim_done message updates the time of the last
successful fencing operation for a failed node.
The code that processes received victim_done messages was ignoring the
message for the reduced victim because the node couldn't be found in
the victims list. This caused the latest fencing information to not be
recorded for the node, causing dlm_controld to wait indefinately for
fencing to complete for the reduced victim.
The fix is to simply record the information from a victim_done message
even if the node is not in the victims list.
bz 678704
Acked-by: Ryan O'Hara <rohara(a)redhat.com>
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
fence/fenced/cpg.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/fence/fenced/cpg.c b/fence/fenced/cpg.c
index a8629b9..99e16a0 100644
--- a/fence/fenced/cpg.c
+++ b/fence/fenced/cpg.c
@@ -652,9 +652,9 @@ static void receive_victim_done(struct fd *fd, struct fd_header *hd, int len)
node = get_node_victim(fd, id->nodeid);
if (!node) {
+ /* see comment below about no node */
log_debug("receive_victim_done %d:%u no victim nodeid %d",
hd->nodeid, seq, id->nodeid);
- return;
}
log_debug("receive_victim_done %d:%u remove victim %d time %llu how %d",
@@ -670,9 +670,11 @@ static void receive_victim_done(struct fd *fd, struct fd_header *hd, int len)
if (hd->nodeid == our_nodeid) {
/* sanity check, I don't think this should happen;
see comment in fence_victims() */
- if (!node->local_victim_done)
- log_error("expect local_victim_done");
- node->local_victim_done = 0;
+ if (node) {
+ if (!node->local_victim_done)
+ log_error("expect local_victim_done");
+ node->local_victim_done = 0;
+ }
} else {
/* save details of fencing operation from master, which
master saves at the time it completes it */
@@ -680,8 +682,12 @@ static void receive_victim_done(struct fd *fd, struct fd_header *hd, int len)
id->fence_how, id->fence_time);
}
- list_del(&node->list);
- free(node);
+ /* we can have no node when reduce_victims() removes it, bz 678704 */
+
+ if (node) {
+ list_del(&node->list);
+ free(node);
+ }
}
/* we know that the quorum value here is consistent with the cpg events
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: 4e79f08f455038bdfb962f941676b7d5d8c21ef8
Parent: 897437313adc8801b38ea42abc4fd07bd486ce3e
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Tue Feb 22 15:56:39 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Tue Feb 22 15:56:39 2011 -0600
fsck.gfs2: segfault in pass1b
The problem occurred when there were duplicate block
references in a dinode but all references in the duplicate
list are eventually deleted due to other corruption.
The fix is an additional check whether the list is empty.
rhbz#679076
---
gfs2/fsck/pass1b.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 090b412..5bbda7c 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -542,7 +542,7 @@ static int handle_dup_blk(struct gfs2_sbd *sbp, struct duptree *b)
last_reference = clear_a_reference(sbp, b, &b->ref_inode_list,
&dh, 0);
- if (last_reference) {
+ if (last_reference && !osi_list_empty(&b->ref_inode_list)) {
uint8_t q;
/* If we're down to a single reference (and not all references
Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=70a61dc4d5…
Commit: 70a61dc4d5d91119da30a7165e70bb9646a6d6c1
Parent: 9ccd853b6d36e99af1100548d1e389fc921f10d4
Author: Jiaju Zhang <jjzhang.linux(a)gmail.com>
AuthorDate: Mon Nov 8 16:07:31 2010 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Feb 22 11:09:10 2011 -0600
dlm_controld: Reset fs_notified when check_fs_done
This situation only seems to arise with ocfs2_controld.
Copying bug description from email
https://www.redhat.com/archives/cluster-devel/2010-November/msg00004.html
> About the issue that dlm_controld and fs_controld sit spinning,
> retrying and replying for the fs_notified check, I have a suspision
> that another scenario may also hit that logic:
>
> If the node->fs_notified has been set to 1 by previous change, when a
> new change comes and needs to check the node->fs_notified, because it
> has not been reset to 0, so check_fs_done will succeed even if
> dlm_controld has not received the notification from fs_controld this
> time.
> For example, given that the following membership changes n, n+1, n+2,
> we see what happens on node X:
> Step 1: cg n: node Y leaves with CPG_REASON_NODEDOWN reason,
> eventually in node X's ls->node_history, node Y's fs_notified
> = 1
> Step 2: cg n+1: node Y joins ...
> Step 3: cg n+2: node Y leaves with CPG_REASON_NODEDOWN reason, one
> possible scenario is: before fs_controld's notification
> arrives, dlm_controld has known node Y is down from CPG
> message and done a lot of work, and it saw node Y's
> fs_notified = 1 (been set in Step 1) then passed the fs check
> wrongly. So node Y's check_fs reset to 0.
> Step 4: fs_controld's notification arrives, it sees node Y's check_fs
> = 0 and assumes dlm_controld has not known node Y is down and
> retries to send the notification. But in fact, dlm_controld
> has already known this and finished all the work, which will
> result in the spinning ...
Signed-off-by: Jiaju Zhang <jjzhang.linux(a)gmail.com>
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/cpg.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 9b0d223..12cb202 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -651,6 +651,7 @@ static int check_fs_done(struct lockspace *ls)
if (node->fs_notified) {
log_group(ls, "check_fs nodeid %d clear", node->nodeid);
node->check_fs = 0;
+ node->fs_notified = 0;
} else {
log_group(ls, "check_fs nodeid %d needs fs notify",
node->nodeid);
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d7…
Commit: d7c4483a3f4a1d91b14e9e7d879f5039ed493027
Parent: 4198c45971a12d59ad565309acd63c46a6809ef6
Author: Shane Bradley <sbradley(a)redhat.com>
AuthorDate: Wed Jan 26 10:05:27 2011 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Tue Feb 15 15:54:22 2011 -0500
rgmanager: Fix nofailback when service is in 'starting' state
If a failover domain has "nofailback" enabled a service that is
"starting" state would still failback to the original. If a
service takes a while to come up and is in the "starting" state
and the original node comes back online while it is in that state
the service will be failed back.
Resolves: rhbz#669440
Signed-off-by: Shane Bradley <sbradley(a)redhat.com>
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/fo_domain.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/daemons/fo_domain.c b/rgmanager/src/daemons/fo_domain.c
index d8d074f..677a859 100644
--- a/rgmanager/src/daemons/fo_domain.c
+++ b/rgmanager/src/daemons/fo_domain.c
@@ -549,7 +549,7 @@ node_should_start(int nodeid, cluster_member_list_t *membership,
* Check to see if the service is started and if we are the owner in case of
* restricted+owner+no failback
*/
- if (svc_state.rs_state == RG_STATE_STARTED)
+ if (svc_state.rs_state == RG_STATE_STARTED || svc_state.rs_state == RG_STATE_STARTING)
started = 1;
if (svc_state.rs_owner == (uint32_t)nodeid)
owned_by_node = 1;
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=41…
Commit: 4198c45971a12d59ad565309acd63c46a6809ef6
Parent: 359a10b3382a5ea30840a1dc9754960e1de04f83
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Feb 9 16:04:50 2011 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Tue Feb 15 15:24:20 2011 -0500
ccs: Update manual page for ccs_tool
Resolves: rhbz#656427
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
ccs/man/ccs_tool.8 | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/ccs/man/ccs_tool.8 b/ccs/man/ccs_tool.8
index e8869c0..e582ed4 100644
--- a/ccs/man/ccs_tool.8
+++ b/ccs/man/ccs_tool.8
@@ -37,6 +37,13 @@ while the cman cluster is operational (i.e. online). Run this on a single
machine to update cluster.conf on all current cluster members. This also
notfies cman of the new config version.
+Note: If ccsd is run on a non-standard base port, you can specify this to
+a \fBccs_tool update\fP in the same manner as you would to \fBccsd\fP:
+
+For example:
+
+ ccs_tool update -P c:40003 /etc/cluster/cluster.conf
+
.TP
\fBupgrade\fP \fI<location>\fP
This command is used to upgrade an old CCS format archive to the new
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=98…
Commit: 98f3a54ca8b1bf4536fb3caac62e5e15cfda2675
Parent: be158e9bd1c3c99475ff4f213c19b1732ab0f14d
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri Jan 21 08:13:08 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Tue Feb 8 15:04:04 2011 -0600
fsck.gfs2 stuck in pass1 on i686
This patch fixes a problem specific to 32-bit architectures.
The shift point calculation for determining where to start looking
for a desired value in the bitmap was wrong because it was
using sizeof(unsigned long) rather than sizeof(unsigned long long).
That caused the bitfit function to start in the wrong place, which
in some circumstances caused the same block to be returned repeatedly
which resulted in infinite loops in fsck.gfs2.
rhbz#675911
---
gfs2/libgfs2/fs_bits.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index ee9dfa7..69b16e9 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -77,7 +77,7 @@ static inline uint64_t gfs2_bit_search(const unsigned long long *ptr,
unsigned long gfs2_bitfit(const unsigned char *buf, const unsigned int len,
unsigned long goal, unsigned char state)
{
- unsigned long spoint = (goal << 1) & ((8 * sizeof(unsigned long)) - 1);
+ unsigned long spoint = (goal << 1) & ((8 * sizeof(unsigned long long)) - 1);
const unsigned long long *ptr = ((unsigned long long *)buf) + (goal >> 5);
const unsigned long long *end = (unsigned long long *)
(buf + ALIGN(len, sizeof(unsigned long long)));
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=17…
Commit: 17dbf63a93049318c985ef4449293778a5fad3d7
Parent: ffa68348491b46319760ad2459a297ec3897f611
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Feb 8 16:36:46 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue Feb 8 16:36:46 2011 +0100
Update udev rules to deal with new udev model
dlm devices are now created in /dev directly, a compat symlink is
then created in /dev/misc to avoid any kind of breakage.
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
dlm/libdlm/51-dlm.rules | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/dlm/libdlm/51-dlm.rules b/dlm/libdlm/51-dlm.rules
index f71e79d..0f22134 100644
--- a/dlm/libdlm/51-dlm.rules
+++ b/dlm/libdlm/51-dlm.rules
@@ -1,5 +1,2 @@
-KERNEL=="dlm-control", NAME="misc/dlm-control", MODE="0666"
-KERNEL=="dlm-monitor", NAME="misc/dlm-monitor", MODE="0666"
-KERNEL=="dlm_default", NAME="misc/dlm_default", MODE="0666"
-KERNEL=="dlm_*", NAME="misc/%k", MODE="0660"
-
+KERNEL=="dlm-control|dlm-monitor|dlm_default", MODE="0666", SYMLINK+="misc/%k"
+KERNEL=="dlm_*", MODE="0660", SYMLINK+="misc/%k"
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: 1d42f8ed7eea12b4bd15744bb746ae9d271722cc
Parent: 0000000000000000000000000000000000000000
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: 2011-02-08 07:29 +0000
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: 2011-02-08 07:29 +0000
annotated tag: v3.1.1 has been created
at 1d42f8ed7eea12b4bd15744bb746ae9d271722cc (tag)
tagging 66ad000089dc330e2467bdf233763cc07a96fba7 (commit)
replaces v3.1.0
v3.1.1 release
Fabio M. Di Nitto (3):
Fix build for distributions that don't use bash as default shell
build: fix make dist target
Update COPYRIGHT file
Marek 'marx' Grac (3):
fence_ipmilan: Add "diag" option to support "ipmitool chassis power diag"
fence_ipmilan: Fix manual page to describe usage with HP iLO 3
fence_eaton_snmp: New fence agent for Eaton devices
Ryan O'Hara (6):
fence_scsi: identify dm-multipath devices correctly
fence_scsi: fix regular expression for grep
fence_scsi: always do sg_turs before registration
fence_scsi: always do sg_turs for dm-mp devices
fence_scsi: verify that on/off actions succeed
fence_scsi: properly log errors for all commands
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: 66ad000089dc330e2467bdf233763cc07a96fba7
Parent: 8a0edf9d60fcc781bc4222c5f320da3a23c98faf
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Feb 8 08:26:05 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue Feb 8 08:26:05 2011 +0100
Update COPYRIGHT file
bump years to 2011
add fence_eaton_snmp information
fix email address to avoid autospam
drop fence_xvm bits since the agent has been dropped ages ago
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
doc/COPYRIGHT | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/doc/COPYRIGHT b/doc/COPYRIGHT
index 83d51aa..b10071c 100644
--- a/doc/COPYRIGHT
+++ b/doc/COPYRIGHT
@@ -1,7 +1,7 @@
Unless specified otherwise in the "exceptions section" below:
Copyright (C) 1997-2003 Sistina Software, Inc. All rights reserved.
-Copyright (C) 2004-2010 Red Hat, Inc. All rights reserved.
+Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
Exceptions:
@@ -9,27 +9,26 @@ fence/agents/apc_snmp/powernet369.mib:
Copyright (c) 2005 American Power Conversion, Inc.
PowerNet is a Trademark of American Power Conversion Corp.
+fence/agents/eaton_snmp/fence_eaton_snmp.py:
+ Copyright (c) 2011 eaton.com
+ Author: Arnaud Quette <ArnaudQuette at Eaton.com>
+
fence/agents/ifmib/fence_ifmib.py:
- Copyright (C) 2008-2010 Ross Vandegrift.
+ Copyright (C) 2008-2011 Ross Vandegrift.
Written by Ross Vandegrift <ross at kallisti.us>
fence/agents/intelmodular/fence_intelmodular.pl:
- Contributed by Matthew Kent <matt(a)bravenet.com>
+ Contributed by Matthew Kent <matt at bravenet.com>
fence/agents/ipmilan/expect.{c,h}:
Copyright (C) 2000 Alan Robertson <alanr at unix.sh>
fence/agents/node_assassin/*
- Copyright (C) 2009-2010 Madison Kelly/Alteeve's Niche!
+ Copyright (C) 2009-2011 Madison Kelly/Alteeve's Niche!
Author: Digimer <digimer at alteeve.com>
-fence/agents/xvm/tcp.c:
- Copyright (C) 2000 Mission Critical Linux
- Copyright (C) 2002-2010 Red Hat, Inc. All rights reserved.
- Author: Jeff Moyer <jmoyer at redhat.com>
-
fence/man/fence_ifmib.8:
- Copyright (C) 2008-2010 Ross Vandegrift.
+ Copyright (C) 2008-2011 Ross Vandegrift.
Written by Ross Vandegrift <ross at kallisti.us>
Authors as known by current RCS as of the time of writing:
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: d9e40ee832d3705c3e952f11efa79d6e155d6277
Parent: 522fef7acb26c7cdc46f5b0da8b20c1900c692b7
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Mon Jan 24 13:54:25 2011 -0600
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Mon Feb 7 12:42:39 2011 -0600
fence_scsi: verify that on/off actions succeed
This patch adds code to verify that both "on" and "off" actions are
successful. This is needed because there seem to be some arrays that
do not report an error even when no registration was created, etc.
These verification steps takes places after the action has been
performed successfully. If an error was encountered while performing
either an "on" or "off" action, fence_scsi will exit and no verification
will take place. Failure to verify that an action was successful for any
device will result is failure.
For the "on" action, do_verify_on will check that the key was
successfully registered with each devices and that a reservation exists
on each device.
For the "off" action, do_verify_off will check that the key was removed
from each device and that a reservation exists on each device.
Resolves: rhbz#644385
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
fence/agents/scsi/fence_scsi.pl | 58 +++++++++++++++++++++++++++++++++++++++
1 files changed, 58 insertions(+), 0 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 7fcb685..0512f3e 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -110,6 +110,62 @@ sub do_action_status ($@)
}
}
+sub do_verify_on ($@)
+{
+ my $self = (caller(0))[3];
+ my ($node_key, @devices) = @_;
+ my $count = 0;
+
+ for $dev (@devices) {
+ my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
+
+ ## check that our key is registered
+ if (scalar (@keys) == 0) {
+ log_debug ("failed to register key $node_key on device $dev");
+ $count++;
+ next;
+ }
+
+ ## check that a reservation exists
+ if (!get_reservation_key ($dev)) {
+ log_debug ("no reservation exists on device $dev");
+ $count++;
+ }
+ }
+
+ if ($count != 0) {
+ log_error ("$self: failed to verify $count devices");
+ }
+}
+
+sub do_verify_off ($@)
+{
+ my $self = (caller(0))[3];
+ my ($node_key, @devices) = @_;
+ my $count = 0;
+
+ for $dev (@devices) {
+ my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
+
+ ## check that our key is not registered
+ if (scalar (@keys) != 0) {
+ log_debug ("failed to remove key $node_key from device $dev");
+ $count++;
+ next;
+ }
+
+ ## check that a reservation exists
+ if (!get_reservation_key ($dev)) {
+ log_debug ("no reservation exists on device $dev");
+ $count++;
+ }
+ }
+
+ if ($count != 0) {
+ log_error ("$self: failed to verify $count devices");
+ }
+}
+
sub do_register ($$$)
{
my $self = (caller(0))[3];
@@ -668,9 +724,11 @@ if (!defined $opt_o) {
##
if ($opt_o =~ /^on$/i) {
do_action_on ($key, @devices);
+ do_verify_on ($key, @devices);
}
elsif ($opt_o =~ /^off$/i) {
do_action_off ($key, @devices);
+ do_verify_off ($key, @devices);
}
elsif ($opt_o =~ /^status/i) {
do_action_status ($key, @devices);
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: 522fef7acb26c7cdc46f5b0da8b20c1900c692b7
Parent: da047800ec78e8015fb6c82af260f2325b8e27ac
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Mon Jan 24 12:47:23 2011 -0600
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Mon Feb 7 12:42:27 2011 -0600
fence_scsi: always do sg_turs for dm-mp devices
This patch fixes a with the original patch posted last week. Before
attempting to register with a device, we should call sg_turs on the
device. If that device is a dm-multipath device, we should call sg_turs
on all the paths. This can be done by simply moving the call to do_reset
to do_register and do_register_ignore.
Also, the patch adds a call to do_reset before doing a "status" action.
If a node has been fenced and then proceeds to check its status, it will
be in "unit attention" state.
Resolves: rhbz#640343
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
fence/agents/scsi/fence_scsi.pl | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 03c692c..7fcb685 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -46,7 +46,6 @@ sub do_action_on ($@)
log_error ("device $dev does not exist") if (! -e $dev);
log_error ("device $dev is not a block device") if (! -b $dev);
- do_reset ($dev);
do_register_ignore ($node_key, $dev);
if (!get_reservation_key ($dev)) {
@@ -94,6 +93,8 @@ sub do_action_status ($@)
log_error ("device $dev does not exist") if (! -e $dev);
log_error ("device $dev is not a block device") if (! -b $dev);
+ do_reset ($dev);
+
my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
if (scalar (@keys) != 0) {
@@ -129,6 +130,8 @@ sub do_register ($$$)
my $cmd;
my $out;
+ do_reset ($dev);
+
$cmd = "sg_persist -n -o -G -K $host_key -S $node_key -d $dev";
$cmd .= " -Z" if (defined $opt_a);
$out = qx { $cmd };
@@ -158,11 +161,13 @@ sub do_register_ignore ($$)
my $cmd;
my $out;
+ do_reset ($dev);
+
$cmd = "sg_persist -n -o -I -S $node_key -d $dev";
$cmd .= " -Z" if (defined $opt_a);
$out = qx { $cmd };
- die "[error]: $self\n" if ($?>>8);
+ die "[error]: $self ($dev)\n" if ($?>>8);
return;
}
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: da047800ec78e8015fb6c82af260f2325b8e27ac
Parent: c9871a397ec024fc9d0ece0fc71b3ee3cca0d480
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Wed Jan 19 14:18:54 2011 -0600
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Mon Feb 7 12:41:45 2011 -0600
fence_scsi: always do sg_turs before registration
If a node has been fenced, or its key has been forcibly removed from
device(s) by another node, the victim will see "unit attention" from the
devices if/when it attempts to re-register. This error is normally
reported just once, but will cause registration to fail. We can safely
avoid this by calling sg_turs prior to each attempt to register with a
device.
Resolves: rhbz#640343
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
fence/agents/scsi/fence_scsi.pl | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 38e5210..03c692c 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -46,6 +46,7 @@ sub do_action_on ($@)
log_error ("device $dev does not exist") if (! -e $dev);
log_error ("device $dev is not a block device") if (! -b $dev);
+ do_reset ($dev);
do_register_ignore ($node_key, $dev);
if (!get_reservation_key ($dev)) {
@@ -226,6 +227,23 @@ sub do_preempt_abort ($$$)
return;
}
+sub do_reset (S)
+{
+ my $self = (caller(0))[3];
+ my ($dev) = @_;
+
+ my $cmd = "sg_turs $dev";
+ my @out = qx { $cmd 2> /dev/null };
+ my $err = ($?>>8);
+
+ ## note that it is not necessarily an error is $err is non-zero,
+ ## so just log the device and status and continue.
+
+ log_debug ("$self (dev=$dev, status=$err)");
+
+ return;
+}
+
sub key_read ()
{
my $self = (caller(0))[3];
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: c9871a397ec024fc9d0ece0fc71b3ee3cca0d480
Parent: e4dbdbf552a70c45957f4da5f6dc578f3e163bc9
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Wed Jan 19 10:57:15 2011 -0600
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Mon Feb 7 12:41:15 2011 -0600
fence_scsi: fix regular expression for grep
When fence_scsi checks to see if a specific keys is registered for a
specific device, it uses grep to look through a list of all registered
keys. The existing regular expression was not specific enough, and could
result in false positives. This patch fixes the problem by using anchors
to make the regular expression more specific.
Resolves: rhbz#670910
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
fence/agents/scsi/fence_scsi.pl | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 620af3f..38e5210 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -71,7 +71,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$/ } get_registration_keys ($dev);
if (scalar (@keys) != 0) {
do_preempt_abort ($host_key, $node_key, $dev);
@@ -93,7 +93,7 @@ sub do_action_status ($@)
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$/ } get_registration_keys ($dev);
if (scalar (@keys) != 0) {
$dev_count++;
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: e4dbdbf552a70c45957f4da5f6dc578f3e163bc9
Parent: 9316eeaac07eddd979819803d0e93a5646cb70c5
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Tue Jan 18 14:21:02 2011 -0600
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Mon Feb 7 12:40:52 2011 -0600
fence_scsi: identify dm-multipath devices correctly
Previously, fence_scsi would only identify /dev/dm* devices as being
multipath devices. This prevented the use of "friendly" dm-multipath
names (eg. /dev/mapper/mpath1). Since fence_scsi can now be passed
devices to operate on, it should be able to handle "friendly" names,
too. This patch fixes the problem by getting the absolute path of the
device at registration time.
Resolves: rhbz#644389
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
fence/agents/scsi/fence_scsi.pl | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 992a3eb..620af3f 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -1,5 +1,6 @@
#!/usr/bin/perl
+use Cwd 'realpath';
use File::Basename;
use Getopt::Std;
use POSIX;
@@ -112,6 +113,8 @@ sub do_register ($$$)
my $self = (caller(0))[3];
my ($host_key, $node_key, $dev) = @_;
+ $dev = realpath ($dev);
+
if (substr ($dev, 5) =~ /^dm/) {
my @slaves = get_mpath_slaves ($dev);
foreach (@slaves) {
@@ -139,6 +142,8 @@ sub do_register_ignore ($$)
my $self = (caller(0))[3];
my ($node_key, $dev) = @_;
+ $dev = realpath ($dev);
+
if (substr ($dev, 5) =~ /^dm/) {
my @slaves = get_mpath_slaves ($dev);
foreach (@slaves) {
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ad…
Commit: ada14ea123c508224f758cd2eb8c5a51c3c19dc0
Parent: cbf98a5623e7177d497092f7a7b0e170b8b3177e
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Feb 7 17:33:21 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Feb 7 17:33:21 2011 +0100
cman init: another fix to network manager detection
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 45a607e..fbca2fb 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -317,7 +317,7 @@ cluster_disabled_at_boot()
network_manager_enabled()
{
- if status NetworkManager > /dev/null 2>&1 || \
+ if status $netmanager > /dev/null 2>&1 || \
chkconfig2 $netmanager; then
errmsg="\nNetwork Manager is either running or configured to run. Please disable it in the cluster."
return 1
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=b4…
Commit: b4dc284f463237afb47c88abbfe48a6209ce9a51
Parent: a6d691f0925effe140e5970522eb1c560da9802e
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Feb 3 16:58:36 2011 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Feb 3 17:46:03 2011 -0500
doc: Update cluster_conf.html to match schema
Resolves: rhbz#618705
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
doc/cluster_conf.html | 143 ++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 119 insertions(+), 24 deletions(-)
diff --git a/doc/cluster_conf.html b/doc/cluster_conf.html
index 17d3f37..5bfafac 100644
--- a/doc/cluster_conf.html
+++ b/doc/cluster_conf.html
@@ -100,10 +100,6 @@
<<a href="#tag_postgres-8">postgres-8</a> ...><br/>
<a href="#ref_CHILDREN">CHILDREN</a><br/>
<<a href="#tag_postgres-8">/postgres-8</a>><br/>
-<br/><a name="ref_TOMCAT-5"/>TOMCAT-5 definition<br/>
- <<a href="#tag_tomcat-5">tomcat-5</a> ...><br/>
- <a href="#ref_CHILDREN">CHILDREN</a><br/>
- <<a href="#tag_tomcat-5">/tomcat-5</a>><br/>
<br/><a name="ref_TOMCAT-6"/>TOMCAT-6 definition<br/>
<<a href="#tag_tomcat-6">tomcat-6</a> ...><br/>
<a href="#ref_CHILDREN">CHILDREN</a><br/>
@@ -136,6 +132,14 @@
<<a href="#tag_nfsserver">nfsserver</a> ...><br/>
<a href="#ref_CHILDREN">CHILDREN</a><br/>
<<a href="#tag_nfsserver">/nfsserver</a>><br/>
+<br/><a name="ref_ORAINSTANCE"/>ORAINSTANCE definition<br/>
+ <<a href="#tag_orainstance">orainstance</a> ...><br/>
+ <a href="#ref_CHILDREN">CHILDREN</a><br/>
+ <<a href="#tag_orainstance">/orainstance</a>><br/>
+<br/><a name="ref_ORALISTENER"/>ORALISTENER definition<br/>
+ <<a href="#tag_oralistener">oralistener</a> ...><br/>
+ <a href="#ref_CHILDREN">CHILDREN</a><br/>
+ <<a href="#tag_oralistener">/oralistener</a>><br/>
<br/><a name="ref_FS"/>FS definition<br/>
<<a href="#tag_fs">fs</a> ...><br/>
<a href="#ref_CHILDREN">CHILDREN</a><br/>
@@ -157,7 +161,6 @@
<a href="#ref_SAMBA">SAMBA</a><br/>
<a href="#ref_MYSQL">MYSQL</a><br/>
<a href="#ref_POSTGRES-8">POSTGRES-8</a><br/>
- <a href="#ref_TOMCAT-5">TOMCAT-5</a><br/>
<a href="#ref_TOMCAT-6">TOMCAT-6</a><br/>
<a href="#ref_LVM">LVM</a><br/>
<a href="#ref_VM">VM</a><br/>
@@ -166,6 +169,8 @@
<a href="#ref_NAMED">NAMED</a><br/>
<a href="#ref_ASEHAAGENT">ASEHAAGENT</a><br/>
<a href="#ref_NFSSERVER">NFSSERVER</a><br/>
+ <a href="#ref_ORAINSTANCE">ORAINSTANCE</a><br/>
+ <a href="#ref_ORALISTENER">ORALISTENER</a><br/>
<a href="#ref_FS">FS</a><br/>
<a href="#ref_ORACLEDB">ORACLEDB</a><br/>
<a href="#ref_RESOURCEACTION">RESOURCEACTION</a><br/>
@@ -231,6 +236,8 @@
<tr valign="top"><td><a href="#tag_nfsserver"><b>nfsserver</b></a></td><td>This defines an NFS server resource.</td></tr>
<tr valign="top"><td><a href="#tag_openldap"><b>openldap</b></a></td><td>Defines an Open LDAP server</td></tr>
<tr valign="top"><td><a href="#tag_oracledb"><b>oracledb</b></a></td><td>Oracle 10g Failover Instance</td></tr>
+<tr valign="top"><td><a href="#tag_orainstance"><b>orainstance</b></a></td><td>Oracle 10g Failover Instance</td></tr>
+<tr valign="top"><td><a href="#tag_oralistener"><b>oralistener</b></a></td><td>Oracle 10g Listener Instance</td></tr>
<tr valign="top"><td><a href="#tag_postgres-8"><b>postgres-8</b></a></td><td>Defines a PostgreSQL server</td></tr>
<tr valign="top"><td><a href="#tag_quorumd"><b>quorumd</b></a></td><td>This element and its attributes define parameters for the quorum disk daemon, quorumd. qdisk(5).</td></tr>
<tr valign="top"><td><a href="#tag_resources"><b>resources</b></a></td><td>Defines global resources which may be referenced in services. You may redefine actions for resources here, but child resource definitions are ignored in this section.</td></tr>
@@ -240,7 +247,6 @@
<tr valign="top"><td><a href="#tag_SAPInstance"><b>SAPInstance</b></a></td><td>SAP instance resource agent</td></tr>
<tr valign="top"><td><a href="#tag_script"><b>script</b></a></td><td>LSB-compliant init script as a clustered resource.</td></tr>
<tr valign="top"><td><a href="#tag_service"><b>service</b></a></td><td>Defines a service (resource group).</td></tr>
-<tr valign="top"><td><a href="#tag_tomcat-5"><b>tomcat-5</b></a></td><td>Defines a Tomcat server</td></tr>
<tr valign="top"><td><a href="#tag_tomcat-6"><b>tomcat-6</b></a></td><td>Defines a Tomcat server</td></tr>
<tr valign="top"><td><a href="#tag_totem"><b>totem</b></a></td><td>OpenAIS msg transport protocol</td></tr>
<tr valign="top"><td><a href="#tag_unfence"><b>unfence</b></a></td><td>Contains devices for unfencing the node. fence_node(8)</td></tr>
@@ -281,6 +287,8 @@ Defines an Apache web server<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_ASEHAagent"/>ASEHAagent</h3>
@@ -303,6 +311,8 @@ Sybase ASE Failover Instance<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_cluster"/>cluster</h3>
@@ -331,6 +341,8 @@ Defines a cluster file system mount.<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_clusternode"/>clusternode</h3>
@@ -371,6 +383,7 @@ The cman element contains attributes that define the following cluster-wide para
<tr><td><b>port</b></td><td> </td></tr>
<tr><td><b>quorum_dev_poll</b></td><td>The amount of time after a qdisk poll, in milliseconds, before a quorum disk is considered dead. The quorum disk daemon, qdisk, periodically sends hello messages to cman and ais, indicating that qdisk is present. If qdisk takes more time to send a hello message to cman and ais than by quorum_dev_poll, then cman declares qdisk dead and prints a message indicating that connection to the quorum device has been lost.</td></tr>
<tr><td><b>shutdown_timeout</b></td><td>Timeout period, in milliseconds, to allow a service to respond during a shutdown.</td></tr>
+ <tr><td><b>transport</b></td><td>Specifies transport mechanism to use. Available values are udp (multicast default), udpb (broadcast), udpu (unicast) and rdma (Infiniband). corosync.conf(5)</td></tr>
<tr><td><b>two_node</b></td><td>The two_node attribute allows you to configure a cluster with only two nodes. Ordinarily, the loss of quorum after one of two nodes fails prevents the remaining node from continuing (if both nodes have one vote.) To enable a two-node cluster, set the two_node value equal to 1. If the two_node value is enabled, the expected_votes value must be set to 1.</td></tr>
<tr><td><b>upgrading</b></td><td>Set this if you are performing a rolling upgrade of the cluster between major releases.</td></tr>
</table><br/>
@@ -389,13 +402,16 @@ Defines the properties of a device used for fencing or unfencing a node. fenced(
<tr><td><b>community</b></td><td>Set the community string</td></tr>
<tr><td><b>cserver</b></td><td>The hostname (and optionally the username in the form of username@hostname) assigned to the device. Refer to the fence_egenera(8) man page for more information.</td></tr>
<tr><td><b>debug</b></td><td>Specify (stdin) or increment (command line) debug level</td></tr>
+ <tr><td><b>delay</b></td><td>Wait this many seconds before fencing is started. fence_egenera(8)</td></tr>
<tr><td><b>device</b></td><td>The device the switch is connected to on the controlling host.</td></tr>
<tr><td><b>devices</b></td><td>List of devices to fence (separated by commas).</td></tr>
<tr><td><b>domain</b></td><td>Virtual Machine (domain name) to fence (deprecated)</td></tr>
<tr><td><b>drac_version</b></td><td>Force DRAC version to use</td></tr>
+ <tr><td><b>esh</b></td><td>Path to the esh command on the cserver. fence_egenera(8)</td></tr>
<tr><td><b>exec</b></td><td>Command to execute</td></tr>
<tr><td><b>hash</b></td><td>Packet hash strength (none, sha1, [sha256], sha512)</td></tr>
<tr><td><b>help</b></td><td>Display help and exit</td></tr>
+ <tr><td><b>hidden_page</b></td><td>Name of hidden page</td></tr>
<tr><td><b>hmc_version</b></td><td>Force HMC version to use (3 or 4)</td></tr>
<tr><td><b>identity_file</b></td><td>Identity file for ssh</td></tr>
<tr><td><b>inet4_only</b></td><td>Forces agent to use IPv4 addresses only</td></tr>
@@ -409,8 +425,11 @@ Defines the properties of a device used for fencing or unfencing a node. fenced(
<tr><td><b>lanplus</b></td><td>For IPMI LAN only. Set value to either True or 1; leave out for false.</td></tr>
<tr><td><b>logfile</b></td><td>Location to output logs from fence_scsi.</td></tr>
<tr><td><b>login</b></td><td>The login name used to access the device. </td></tr>
+ <tr><td><b>login_timeout</b></td><td>Wait X seconds for cmd prompt after login</td></tr>
+ <tr><td><b>lpan</b></td><td>The lpan to operate on. fence_egenera(8)</td></tr>
<tr><td><b>managed</b></td><td>Managed system name</td></tr>
<tr><td><b>method</b></td><td>Method to fence (onoff or cycle)</td></tr>
+ <tr><td><b>missing_as_off</b></td><td>Missing port returns OFF instead of failure</td></tr>
<tr><td><b>module_name</b></td><td>DRAC/MC module name</td></tr>
<tr><td><b>multicast_address</b></td><td>Multicast address (default=225.0.0.12 / ff05::3:1)</td></tr>
<tr><td><b>nodename</b></td><td>Name of the node to be fenced. Refer to fence_scsi(8) for more information.</td></tr>
@@ -419,7 +438,11 @@ Defines the properties of a device used for fencing or unfencing a node. fenced(
<tr><td><b>passwd</b></td><td>The password used to authenticate the connection to the device.</td></tr>
<tr><td><b>passwd_script</b></td><td>The script that supplies a password for access to the fence device. Using this supersedes the Password parameter.</td></tr>
<tr><td><b>port</b></td><td>The switch outlet number.</td></tr>
+ <tr><td><b>power_timeout</b></td><td>Test X seconds for status change after ON/OFF</td></tr>
+ <tr><td><b>power_wait</b></td><td>Wait X seconds after issuing ON/OFF</td></tr>
+ <tr><td><b>pserver</b></td><td>The pserver to operate on. fence_egenera(8)</td></tr>
<tr><td><b>retrans</b></td><td>Multicast retransmit time (in 1/10sec; default=20)</td></tr>
+ <tr><td><b>retry_on</b></td><td>Count of attempts to retry power on</td></tr>
<tr><td><b>ribcl</b></td><td>Force ribcl version to use</td></tr>
<tr><td><b>rpowerpath</b></td><td></td></tr>
<tr><td><b>secure</b></td><td>SSH connection</td></tr>
@@ -427,6 +450,7 @@ Defines the properties of a device used for fencing or unfencing a node. fenced(
<tr><td><b>serial_device</b></td><td>Serial device (default=/dev/ttyS1)</td></tr>
<tr><td><b>serial_params</b></td><td>Serial Parameters (default=115200,8N1)</td></tr>
<tr><td><b>servers</b></td><td>The hostname of each GNBD to disable. For multiple hostnames, separate each hostname with a space.</td></tr>
+ <tr><td><b>shell_timeout</b></td><td>Wait X seconds for cmd prompt after issuing command</td></tr>
<tr><td><b>snmp_auth_prot</b></td><td>Set authentication protocol (MD5|SHA)</td></tr>
<tr><td><b>snmp_priv_passwd</b></td><td>Set privacy protocol password</td></tr>
<tr><td><b>snmp_priv_passwd_script</b></td><td>Script to run to retrieve privacy password</td></tr>
@@ -437,6 +461,7 @@ Defines the properties of a device used for fencing or unfencing a node. fenced(
<tr><td><b>switch</b></td><td>Physical switch number on device</td></tr>
<tr><td><b>timeout</b></td><td>Fencing timeout (in seconds; default=30)</td></tr>
<tr><td><b>udpport</b></td><td>UDP/TCP port to use for connection with device</td></tr>
+ <tr><td><b>user</b></td><td>See fence_egenera(8)</td></tr>
<tr><td><b>use_uuid</b></td><td>Treat [domain] as UUID instead of domain name. This is provided for compatibility with older fence_xvmd installations.</td></tr>
<tr><td><b>verbose</b></td><td>Verbose mode</td></tr>
<tr><td><b>version</b></td><td>Display version information and exit</td></tr>
@@ -526,13 +551,16 @@ Defines fence device properties. fenced(8)<br/>
<tr><td><b>community</b></td><td>Set the community string</td></tr>
<tr><td><b>cserver</b></td><td>The hostname (and optionally the username in the form of username@hostname) assigned to the device. Refer to the fence_egenera(8) man page for more information.</td></tr>
<tr><td><b>debug</b></td><td>Specify (stdin) or increment (command line) debug level</td></tr>
+ <tr><td><b>delay</b></td><td>Wait this many seconds before fencing is started. fence_egenera(8)</td></tr>
<tr><td><b>device</b></td><td>The device the switch is connected to on the controlling host.</td></tr>
<tr><td><b>devices</b></td><td>List of devices to fence (separated by commas).</td></tr>
<tr><td><b>domain</b></td><td>Virtual Machine (domain name) to fence (deprecated)</td></tr>
<tr><td><b>drac_version</b></td><td>Force DRAC version to use</td></tr>
+ <tr><td><b>esh</b></td><td>Path to the esh command on the cserver. fence_egenera(8)</td></tr>
<tr><td><b>exec</b></td><td>Command to execute</td></tr>
<tr><td><b>hash</b></td><td>Packet hash strength (none, sha1, [sha256], sha512)</td></tr>
<tr><td><b>help</b></td><td>Display help and exit</td></tr>
+ <tr><td><b>hidden_page</b></td><td>Name of hidden page</td></tr>
<tr><td><b>hmc_version</b></td><td>Force HMC version to use (3 or 4)</td></tr>
<tr><td><b>identity_file</b></td><td>Identity file for ssh</td></tr>
<tr><td><b>inet4_only</b></td><td>Forces agent to use IPv4 addresses only</td></tr>
@@ -546,8 +574,11 @@ Defines fence device properties. fenced(8)<br/>
<tr><td><b>lanplus</b></td><td>For IPMI LAN only. Set value to either True or 1; leave out for false.</td></tr>
<tr><td><b>logfile</b></td><td>Location to output logs from fence_scsi.</td></tr>
<tr><td><b>login</b></td><td>The login name used to access the device. </td></tr>
+ <tr><td><b>login_timeout</b></td><td>Wait X seconds for cmd prompt after login</td></tr>
+ <tr><td><b>lpan</b></td><td>The lpan to operate on. fence_egenera(8)</td></tr>
<tr><td><b>managed</b></td><td>Managed system name</td></tr>
<tr><td><b>method</b></td><td>Method to fence (onoff or cycle)</td></tr>
+ <tr><td><b>missing_as_off</b></td><td>Missing port returns OFF instead of failure</td></tr>
<tr><td><b>module_name</b></td><td>DRAC/MC module name</td></tr>
<tr><td><b>multicast_address</b></td><td>Multicast address (default=225.0.0.12 / ff05::3:1)</td></tr>
<tr><td><b>nodename</b></td><td>Name of the node to be fenced. Refer to fence_scsi(8) for more information.</td></tr>
@@ -556,7 +587,11 @@ Defines fence device properties. fenced(8)<br/>
<tr><td><b>passwd</b></td><td>The password used to authenticate the connection to the device.</td></tr>
<tr><td><b>passwd_script</b></td><td>The script that supplies a password for access to the fence device. Using this supersedes the Password parameter.</td></tr>
<tr><td><b>port</b></td><td>The switch outlet number.</td></tr>
+ <tr><td><b>power_timeout</b></td><td>Test X seconds for status change after ON/OFF</td></tr>
+ <tr><td><b>power_wait</b></td><td>Wait X seconds after issuing ON/OFF</td></tr>
+ <tr><td><b>pserver</b></td><td>The pserver to operate on. fence_egenera(8)</td></tr>
<tr><td><b>retrans</b></td><td>Multicast retransmit time (in 1/10sec; default=20)</td></tr>
+ <tr><td><b>retry_on</b></td><td>Count of attempts to retry power on</td></tr>
<tr><td><b>ribcl</b></td><td>Force ribcl version to use</td></tr>
<tr><td><b>rpowerpath</b></td><td></td></tr>
<tr><td><b>secure</b></td><td>SSH connection</td></tr>
@@ -564,6 +599,7 @@ Defines fence device properties. fenced(8)<br/>
<tr><td><b>serial_device</b></td><td>Serial device (default=/dev/ttyS1)</td></tr>
<tr><td><b>serial_params</b></td><td>Serial Parameters (default=115200,8N1)</td></tr>
<tr><td><b>servers</b></td><td>The hostname of each GNBD to disable. For multiple hostnames, separate each hostname with a space.</td></tr>
+ <tr><td><b>shell_timeout</b></td><td>Wait X seconds for cmd prompt after issuing command</td></tr>
<tr><td><b>snmp_auth_prot</b></td><td>Set authentication protocol (MD5|SHA)</td></tr>
<tr><td><b>snmp_priv_passwd</b></td><td>Set privacy protocol password</td></tr>
<tr><td><b>snmp_priv_passwd_script</b></td><td>Script to run to retrieve privacy password</td></tr>
@@ -574,6 +610,7 @@ Defines fence device properties. fenced(8)<br/>
<tr><td><b>switch</b></td><td>Physical switch number on device</td></tr>
<tr><td><b>timeout</b></td><td>Fencing timeout (in seconds; default=30)</td></tr>
<tr><td><b>udpport</b></td><td>UDP/TCP port to use for connection with device</td></tr>
+ <tr><td><b>user</b></td><td>See fence_egenera(8)</td></tr>
<tr><td><b>use_uuid</b></td><td>Treat [domain] as UUID instead of domain name. This is provided for compatibility with older fence_xvmd installations.</td></tr>
<tr><td><b>verbose</b></td><td>Verbose mode</td></tr>
<tr><td><b>version</b></td><td>Display version information and exit</td></tr>
@@ -632,6 +669,8 @@ Defines a file system mount.<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_gfs_controld"/>gfs_controld</h3>
@@ -681,6 +720,7 @@ This is an IP address.<br/>
<br/>
<table><tr valign="top"><td>Attribute</td><td>Description</td></tr>
<tr><td><b>address</b></td><td>IP Address</td></tr>
+ <tr><td><b>disable_rdisc</b></td><td>Disable updating of routing using RDISC protocol</td></tr>
<tr><td><b>family</b></td><td>Family</td></tr>
<tr><td><b>monitor_link</b></td><td>Monitor NIC Link</td></tr>
<tr><td><b>nfslock</b></td><td>Enable NFS lock workarounds</td></tr>
@@ -690,6 +730,8 @@ This is an IP address.<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_lockspace"/>lockspace</h3>
@@ -742,6 +784,8 @@ LVM Failover script<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_master"/>master</h3>
@@ -782,6 +826,8 @@ Defines a MySQL database server<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_named"/>named</h3>
@@ -800,6 +846,8 @@ Defines an instance of named server<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_netfs"/>netfs</h3>
@@ -819,6 +867,8 @@ Defines an NFS/CIFS file system mount.<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_nfsclient"/>nfsclient</h3>
@@ -839,6 +889,8 @@ Defines an NFS client.<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_nfsexport"/>nfsexport</h3>
@@ -854,6 +906,8 @@ This defines an NFS export.<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_nfsserver"/>nfsserver</h3>
@@ -868,6 +922,8 @@ This defines an NFS server resource.<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_openldap"/>openldap</h3>
@@ -885,6 +941,8 @@ Defines an Open LDAP server<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_oracledb"/>oracledb</h3>
@@ -902,6 +960,42 @@ Oracle 10g Failover Instance<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
+</table><br/>
+Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
+<h3><a name="tag_orainstance"/>orainstance</h3>
+Oracle 10g Failover Instance<br/>
+<br/>
+<table><tr valign="top"><td>Attribute</td><td>Description</td></tr>
+ <tr><td><b>home</b></td><td>Oracle Home Directory</td></tr>
+ <tr><td><b>listeners</b></td><td>Oracle listeners</td></tr>
+ <tr><td><b>lockfile</b></td><td>Pathname for lockfile</td></tr>
+ <tr><td><b>name</b></td><td>Oracle SID</td></tr>
+ <tr><td><b>ref</b></td><td>Reference to existing orainstance resource in the resources section.</td></tr>
+ <tr><td><b>user</b></td><td>Oracle User Name</td></tr>
+ <tr><td><b>__enforce_timeouts</b></td><td>Consider a timeout for operations as fatal.</td></tr>
+ <tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
+ <tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
+ <tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
+</table><br/>
+Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
+<h3><a name="tag_oralistener"/>oralistener</h3>
+Oracle 10g Listener Instance<br/>
+<br/>
+<table><tr valign="top"><td>Attribute</td><td>Description</td></tr>
+ <tr><td><b>home</b></td><td>Oracle Home Directory</td></tr>
+ <tr><td><b>name</b></td><td>Listener name</td></tr>
+ <tr><td><b>ref</b></td><td>Reference to existing oralistener resource in the resources section.</td></tr>
+ <tr><td><b>user</b></td><td>Oracle User Name</td></tr>
+ <tr><td><b>__enforce_timeouts</b></td><td>Consider a timeout for operations as fatal.</td></tr>
+ <tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
+ <tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
+ <tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_postgres-8"/>postgres-8</h3>
@@ -919,6 +1013,8 @@ Defines a PostgreSQL server<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_quorumd"/>quorumd</h3>
@@ -941,6 +1037,9 @@ This element and its attributes define parameters for the quorum disk daemon, qu
<tr><td><b>status_file</b></td><td>Debugging file. qdisk(5).</td></tr>
<tr><td><b>stop_cman</b></td><td>Stop cman if the quorum disk cannot be found during startup. qdisk(5).</td></tr>
<tr><td><b>tko</b></td><td>The number of cycles a node must miss to be declared dead. qdisk(5).</td></tr>
+ <tr><td><b>tko_up</b></td><td>Amount of positive changes before a host is considered online. qdisk(5).</td></tr>
+ <tr><td><b>upgrade_wait</b></td><td>Amount of cycles wait for conflicts for a bid for master status. qdisk(5).</td></tr>
+ <tr><td><b>use_uptime</b></td><td>Use /proc/uptime instead of gettimeofday(). qdisk(5).</td></tr>
<tr><td><b>votes</b></td><td>The number of votes the quorum daemon advertises to CMAN when it has a high enough score. qdisk(5).</td></tr>
</table><br/>
Children: <a href="#tag_heuristic">heuristic</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
@@ -975,6 +1074,8 @@ Dynamic smbd/nmbd resource agent<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_SAPDatabase"/>SAPDatabase</h3>
@@ -1001,6 +1102,8 @@ SAP database resource agent<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_SAPInstance"/>SAPInstance</h3>
@@ -1022,6 +1125,8 @@ SAP instance resource agent<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_script"/>script</h3>
@@ -1036,6 +1141,8 @@ LSB-compliant init script as a clustered resource.<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_service"/>service</h3>
@@ -1059,24 +1166,8 @@ Defines a service (resource group).<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
-</table><br/>
-Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
-<h3><a name="tag_tomcat-5"/>tomcat-5</h3>
-Defines a Tomcat server<br/>
-<br/>
-<table><tr valign="top"><td>Attribute</td><td>Description</td></tr>
- <tr><td><b>catalina_base</b></td><td>Catalina base directory (differs for each service)</td></tr>
- <tr><td><b>catalina_options</b></td><td>Other command-line options for Catalina</td></tr>
- <tr><td><b>config_file</b></td><td>Config File</td></tr>
- <tr><td><b>name</b></td><td>Name</td></tr>
- <tr><td><b>ref</b></td><td>Reference to existing tomcat-5 resource in the resources section.</td></tr>
- <tr><td><b>service_name</b></td><td>Inherit the service name.</td></tr>
- <tr><td><b>shutdown_wait</b></td><td>Wait X seconds for correct end of service shutdown</td></tr>
- <tr><td><b>tomcat_user</b></td><td>User who runs the Tomcat server</td></tr>
- <tr><td><b>__enforce_timeouts</b></td><td>Consider a timeout for operations as fatal.</td></tr>
- <tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
- <tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
- <tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_tomcat-6"/>tomcat-6</h3>
@@ -1092,6 +1183,8 @@ Defines a Tomcat server<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
<h3><a name="tag_totem"/>totem</h3>
@@ -1140,6 +1233,8 @@ Defines a Virtual Machine<br/>
<tr><td><b>__failure_expire_time</b></td><td>Amount of time before a failure is forgotten.</td></tr>
<tr><td><b>__independent_subtree</b></td><td>Treat this and all children as an independent subtree.</td></tr>
<tr><td><b>__max_failures</b></td><td>Maximum number of failures before returning a failure to a status check.</td></tr>
+ <tr><td><b>__max_restarts</b></td><td>Maximum number restarts for an independent subtree before giving up.</td></tr>
+ <tr><td><b>__restart_expire_time</b></td><td>Amount of time before a failure is forgotten for an independent subtree.</td></tr>
</table><br/>
Children: <a href="#ref_CHILDREN">CHILDREN</a> <br/><a href="#" onClick="history.go(-1)" />Back</a> | <a href="#toc_tag_reference">Contents</a>
</html>
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a6…
Commit: a6d691f0925effe140e5970522eb1c560da9802e
Parent: 3505bc008d71100acf8b11bcfc494873904957ef
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Feb 3 16:34:30 2011 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Feb 3 17:46:01 2011 -0500
config: Update schema
Resolves: rhbz#618705
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
config/tools/xml/cluster.rng.in | 848 ++++++++++++++++++++++++++++++++++++---
1 files changed, 783 insertions(+), 65 deletions(-)
diff --git a/config/tools/xml/cluster.rng.in b/config/tools/xml/cluster.rng.in
index 505e07a..75bbd28 100644
--- a/config/tools/xml/cluster.rng.in
+++ b/config/tools/xml/cluster.rng.in
@@ -1011,6 +1011,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1038,6 +1044,9 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="sleeptime" rha:description="Amount of time (seconds) to sleep."/>
</optional>
+ <optional>
+ <attribute name="disable_rdisc" rha:description="Disable updating of routing using RDISC protocol"/>
+ </optional>
</group>
</choice>
<optional>
@@ -1053,6 +1062,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1105,6 +1120,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1144,6 +1165,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1178,6 +1205,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1223,6 +1256,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1273,6 +1312,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1318,6 +1363,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1363,6 +1414,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1408,6 +1465,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1456,6 +1519,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1501,52 +1570,10 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
- <ref name="CHILDREN"/>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
</optional>
- </element>
- </define>
-
-
- <define name="TOMCAT-5">
- <element name="tomcat-5" rha:description="Defines a Tomcat server">
- <choice>
- <group>
- <!-- rgmanager specific stuff -->
- <attribute name="ref" rha:description="Reference to existing tomcat-5 resource in the resources section."/>
- </group>
- <group>
- <attribute name="name" rha:description="Name"/>
- <optional>
- <attribute name="config_file" rha:description="Config File"/>
- </optional>
- <optional>
- <attribute name="tomcat_user" rha:description="User who runs the Tomcat server"/>
- </optional>
- <optional>
- <attribute name="catalina_options" rha:description="Other command-line options for Catalina"/>
- </optional>
- <optional>
- <attribute name="catalina_base" rha:description="Catalina base directory (differs for each service)"/>
- </optional>
- <optional>
- <attribute name="shutdown_wait" rha:description="Wait X seconds for correct end of service shutdown"/>
- </optional>
- <optional>
- <attribute name="service_name" rha:description="Inherit the service name."/>
- </optional>
- </group>
- </choice>
<optional>
- <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree."/>
- </optional>
- <optional>
- <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal."/>
- </optional>
- <optional>
- <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check."/>
- </optional>
- <optional>
- <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
</optional>
<optional>
<ref name="CHILDREN"/>
@@ -1588,6 +1615,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1628,6 +1661,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1712,6 +1751,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1769,6 +1814,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1839,6 +1890,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1887,6 +1944,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1927,6 +1990,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -1963,6 +2032,94 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
+ <ref name="CHILDREN"/>
+ </optional>
+ </element>
+ </define>
+
+
+ <define name="ORAINSTANCE">
+ <element name="orainstance" rha:description="Oracle 10g Failover Instance">
+ <choice>
+ <group>
+ <!-- rgmanager specific stuff -->
+ <attribute name="ref" rha:description="Reference to existing orainstance resource in the resources section."/>
+ </group>
+ <group>
+ <attribute name="name" rha:description="Oracle SID"/>
+ <attribute name="user" rha:description="Oracle User Name"/>
+ <attribute name="home" rha:description="Oracle Home Directory"/>
+ <optional>
+ <attribute name="listeners" rha:description="Oracle listeners"/>
+ </optional>
+ <optional>
+ <attribute name="lockfile" rha:description="Pathname for lockfile"/>
+ </optional>
+ </group>
+ </choice>
+ <optional>
+ <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree."/>
+ </optional>
+ <optional>
+ <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal."/>
+ </optional>
+ <optional>
+ <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check."/>
+ </optional>
+ <optional>
+ <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
+ </optional>
+ <optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
+ <ref name="CHILDREN"/>
+ </optional>
+ </element>
+ </define>
+
+
+ <define name="ORALISTENER">
+ <element name="oralistener" rha:description="Oracle 10g Listener Instance">
+ <choice>
+ <group>
+ <!-- rgmanager specific stuff -->
+ <attribute name="ref" rha:description="Reference to existing oralistener resource in the resources section."/>
+ </group>
+ <group>
+ <attribute name="name" rha:description="Listener name"/>
+ <attribute name="user" rha:description="Oracle User Name"/>
+ <attribute name="home" rha:description="Oracle Home Directory"/>
+ </group>
+ </choice>
+ <optional>
+ <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree."/>
+ </optional>
+ <optional>
+ <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal."/>
+ </optional>
+ <optional>
+ <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check."/>
+ </optional>
+ <optional>
+ <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
+ </optional>
+ <optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -2019,6 +2176,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -2060,6 +2223,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
</optional>
<optional>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/>
+ </optional>
+ <optional>
<ref name="CHILDREN"/>
</optional>
</element>
@@ -2081,7 +2250,6 @@ To validate your cluster.conf against this schema, run:
<ref name="SAMBA"/>
<ref name="MYSQL"/>
<ref name="POSTGRES-8"/>
- <ref name="TOMCAT-5"/>
<ref name="TOMCAT-6"/>
<ref name="LVM"/>
<ref name="VM"/>
@@ -2090,6 +2258,8 @@ To validate your cluster.conf against this schema, run:
<ref name="NAMED"/>
<ref name="ASEHAAGENT"/>
<ref name="NFSSERVER"/>
+ <ref name="ORAINSTANCE"/>
+ <ref name="ORALISTENER"/>
<ref name="FS"/>
<ref name="ORACLEDB"/>
<ref name="RESOURCEACTION"/>
@@ -2186,8 +2356,10 @@ To validate your cluster.conf against this schema, run:
the impilan fence device.-->
<!-- Brocade, McData, SANBox2, Bladecenter,bullpap, ipmilan -->
<group>
+ <optional>
<attribute name="ipaddr" rha:description="IP address or the name
of the device." rha:sample="rack007"/>
+ </optional>
<optional>
<attribute name="login" rha:description="The login name used to
access the device. " rha:sample="admin"/>
@@ -2386,6 +2558,11 @@ To validate your cluster.conf against this schema, run:
<!-- end non-generated device definitions -->
<!-- begin auto-generated device definitions -->
+ <!-- No metadata for fencing.py -->
+ <!-- No metadata for fencing_snmp.py -->
+ <!-- No metadata for fence_nss_wrapper -->
+ <!-- No metadata for fence_vmware_helper -->
+
<!-- fence_vmware -->
<group>
<optional>
@@ -2419,6 +2596,9 @@ To validate your cluster.conf against this schema, run:
<attribute name="secure" rha:description="SSH connection" />
</optional>
<optional>
+ <attribute name="identity_file" rha:description="Identity file for ssh" />
+ </optional>
+ <optional>
<attribute name="vmware_datacenter" rha:description="Show only machines in specified datacenter" />
</optional>
<optional>
@@ -2436,6 +2616,24 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
@@ -2463,6 +2661,9 @@ To validate your cluster.conf against this schema, run:
<attribute name="secure" rha:description="SSH connection" />
</optional>
<optional>
+ <attribute name="identity_file" rha:description="Identity file for ssh" />
+ </optional>
+ <optional>
<attribute name="partition" rha:description="Partition name" />
</optional>
<optional>
@@ -2498,6 +2699,24 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
@@ -2557,6 +2776,27 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="missing_as_off" rha:description="Missing port returns OFF instead of failure" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
@@ -2628,6 +2868,24 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
@@ -2699,6 +2957,24 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
@@ -2726,6 +3002,9 @@ To validate your cluster.conf against this schema, run:
<attribute name="port" rha:description="Physical plug number or name of virtual machine" />
</optional>
<optional>
+ <attribute name="hidden_page" rha:description="Name of hidden page" />
+ </optional>
+ <optional>
<attribute name="verbose" rha:description="Verbose mode" />
</optional>
<optional>
@@ -2740,6 +3019,12 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
@@ -2799,8 +3084,120 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
+ <!-- No metadata for fence_xcat -->
+ <!-- No metadata for fence_rackswitch -->
+ <!-- No metadata for fence_rsb -->
+
+ <!-- fence_bladecenter_snmp -->
+ <group>
+ <optional>
+ <attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
+ </optional>
+ <optional>
+ <attribute name="action" rha:description="Fencing Action" />
+ </optional>
+ <optional>
+ <attribute name="ipaddr" rha:description="IP Address or Hostname" />
+ </optional>
+ <optional>
+ <attribute name="login" rha:description="Login Name" />
+ </optional>
+ <optional>
+ <attribute name="passwd" rha:description="Login password or passphrase" />
+ </optional>
+ <optional>
+ <attribute name="passwd_script" rha:description="Script to retrieve password" />
+ </optional>
+ <optional>
+ <attribute name="port" rha:description="Physical plug number or name of virtual machine" />
+ </optional>
+ <optional>
+ <attribute name="snmp_version" rha:description="Specifies SNMP version to use (1,2c,3)" />
+ </optional>
+ <optional>
+ <attribute name="community" rha:description="Set the community string" />
+ </optional>
+ <optional>
+ <attribute name="snmp_auth_prot" rha:description="Set authentication protocol (MD5|SHA)" />
+ </optional>
+ <optional>
+ <attribute name="snmp_sec_level" rha:description="Set security level (noAuthNoPriv|authNoPriv|authPriv)" />
+ </optional>
+ <optional>
+ <attribute name="snmp_priv_prot" rha:description="Set privacy protocol (DES|AES)" />
+ </optional>
+ <optional>
+ <attribute name="snmp_priv_passwd" rha:description="Set privacy protocol password" />
+ </optional>
+ <optional>
+ <attribute name="snmp_priv_passwd_script" rha:description="Script to run to retrieve privacy password" />
+ </optional>
+ <optional>
+ <attribute name="udpport" rha:description="UDP/TCP port to use for connection with device" />
+ </optional>
+ <optional>
+ <attribute name="inet4_only" rha:description="Forces agent to use IPv4 addresses only" />
+ </optional>
+ <optional>
+ <attribute name="inet6_only" rha:description="Forces agent to use IPv6 addresses only" />
+ </optional>
+ <optional>
+ <attribute name="verbose" rha:description="Verbose mode" />
+ </optional>
+ <optional>
+ <attribute name="debug" rha:description="Write debug information to given file" />
+ </optional>
+ <optional>
+ <attribute name="version" rha:description="Display version information and exit" />
+ </optional>
+ <optional>
+ <attribute name="help" rha:description="Display help and exit" />
+ </optional>
+ <optional>
+ <attribute name="separator" rha:description="Separator for CSV created by operation list" />
+ </optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
+ </group>
+
+ <!-- No metadata for fence_cpint -->
+ <!-- No metadata for fence_drac -->
<!-- fence_ipmilan -->
<group>
@@ -2826,7 +3223,7 @@ To validate your cluster.conf against this schema, run:
<attribute name="login" rha:description="Username/Login (if required) to control power on IPMI device" />
</optional>
<optional>
- <attribute name="action" rha:description="Operation to perform. Valid operations: on, off, reboot, status, list, monitor or metadata" />
+ <attribute name="action" rha:description="Operation to perform. Valid operations: on, off, reboot, status, list, diag, monitor or metadata" />
</optional>
<optional>
<attribute name="timeout" rha:description="Timeout (sec) for IPMI operation" />
@@ -2838,6 +3235,12 @@ To validate your cluster.conf against this schema, run:
<attribute name="method" rha:description="Method to fence (onoff or cycle)" />
</optional>
<optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after on/off operation" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
+ <optional>
<attribute name="verbose" rha:description="Verbose mode" />
</optional>
</group>
@@ -2870,6 +3273,9 @@ To validate your cluster.conf against this schema, run:
<attribute name="secure" rha:description="SSH connection" />
</optional>
<optional>
+ <attribute name="identity_file" rha:description="Identity file for ssh" />
+ </optional>
+ <optional>
<attribute name="ipport" rha:description="TCP port to use for connection with device" />
</optional>
<optional>
@@ -2884,6 +3290,92 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="help" rha:description="Display help and exit" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
+ </group>
+
+
+ <!-- fence_cisco_ucs -->
+ <group>
+ <optional>
+ <attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
+ </optional>
+ <optional>
+ <attribute name="action" rha:description="Fencing Action" />
+ </optional>
+ <optional>
+ <attribute name="ipaddr" rha:description="IP Address or Hostname" />
+ </optional>
+ <optional>
+ <attribute name="login" rha:description="Login Name" />
+ </optional>
+ <optional>
+ <attribute name="passwd" rha:description="Login password or passphrase" />
+ </optional>
+ <optional>
+ <attribute name="passwd_script" rha:description="Script to retrieve password" />
+ </optional>
+ <optional>
+ <attribute name="ssl" rha:description="SSL connection" />
+ </optional>
+ <optional>
+ <attribute name="inet4_only" rha:description="Forces agent to use IPv4 addresses only" />
+ </optional>
+ <optional>
+ <attribute name="inet6_only" rha:description="Forces agent to use IPv6 addresses only" />
+ </optional>
+ <optional>
+ <attribute name="ipport" rha:description="TCP port to use for connection with device" />
+ </optional>
+ <optional>
+ <attribute name="port" rha:description="Physical plug number or name of virtual machine" />
+ </optional>
+ <optional>
+ <attribute name="verbose" rha:description="Verbose mode" />
+ </optional>
+ <optional>
+ <attribute name="debug" rha:description="Write debug information to given file" />
+ </optional>
+ <optional>
+ <attribute name="version" rha:description="Display version information and exit" />
+ </optional>
+ <optional>
+ <attribute name="help" rha:description="Display help and exit" />
+ </optional>
+ <optional>
+ <attribute name="separator" rha:description="Separator for CSV created by operation list" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
@@ -2940,8 +3432,28 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
+ <!-- No metadata for fence_mcdata -->
+ <!-- No metadata for fence_bullpap -->
<!-- fence_wti -->
<group>
@@ -2970,6 +3482,9 @@ To validate your cluster.conf against this schema, run:
<attribute name="secure" rha:description="SSH connection" />
</optional>
<optional>
+ <attribute name="identity_file" rha:description="Identity file for ssh" />
+ </optional>
+ <optional>
<attribute name="port" rha:description="Physical plug number or name of virtual machine" />
</optional>
<optional>
@@ -2996,8 +3511,27 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
+ <!-- No metadata for fence_zvm -->
<!-- fence_drac5 -->
<group>
@@ -3026,6 +3560,9 @@ To validate your cluster.conf against this schema, run:
<attribute name="secure" rha:description="SSH connection" />
</optional>
<optional>
+ <attribute name="identity_file" rha:description="Identity file for ssh" />
+ </optional>
+ <optional>
<attribute name="drac_version" rha:description="Force DRAC version to use" />
</optional>
<optional>
@@ -3055,8 +3592,55 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
+ <!-- No metadata for fence_vixel -->
+ <!-- No metadata for fence_baytech -->
+
+ <!-- fence_scsi -->
+ <group>
+ <optional>
+ <attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
+ </optional>
+ <optional>
+ <attribute name="aptpl" rha:description="Use APTPL flag for registrations" />
+ </optional>
+ <optional>
+ <attribute name="devices" rha:description="List of devices to be used for fencing action" />
+ </optional>
+ <optional>
+ <attribute name="logfile" rha:description="File to write error/debug messages" />
+ </optional>
+ <optional>
+ <attribute name="key" rha:description="Key value to be used for fencing action" />
+ </optional>
+ <optional>
+ <attribute name="action" rha:description="Fencing action" />
+ </optional>
+ <optional>
+ <attribute name="nodename" rha:description="Name of node" />
+ </optional>
+ </group>
+
+ <!-- No metadata for fence_brocade -->
<!-- fence_ilo_mp -->
<group>
@@ -3082,6 +3666,9 @@ To validate your cluster.conf against this schema, run:
<attribute name="secure" rha:description="SSH connection" />
</optional>
<optional>
+ <attribute name="identity_file" rha:description="Identity file for ssh" />
+ </optional>
+ <optional>
<attribute name="cmd_prompt" rha:description="Force command prompt" />
</optional>
<optional>
@@ -3108,6 +3695,24 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
@@ -3138,6 +3743,9 @@ To validate your cluster.conf against this schema, run:
<attribute name="port" rha:description="Physical plug number or name of virtual machine" />
</optional>
<optional>
+ <attribute name="identity_file" rha:description="Identity file for ssh" />
+ </optional>
+ <optional>
<attribute name="switch" rha:description="Physical switch number on device" />
</optional>
<optional>
@@ -3164,6 +3772,24 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
@@ -3191,6 +3817,9 @@ To validate your cluster.conf against this schema, run:
<attribute name="secure" rha:description="SSH connection" />
</optional>
<optional>
+ <attribute name="identity_file" rha:description="Identity file for ssh" />
+ </optional>
+ <optional>
<attribute name="inet4_only" rha:description="Forces agent to use IPv4 addresses only" />
</optional>
<optional>
@@ -3211,10 +3840,28 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="help" rha:description="Display help and exit" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
- <!-- fence_ibmblade -->
+ <!-- fence_rhevm -->
<group>
<optional>
<attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
@@ -3235,55 +3882,53 @@ To validate your cluster.conf against this schema, run:
<attribute name="passwd_script" rha:description="Script to retrieve password" />
</optional>
<optional>
- <attribute name="port" rha:description="Physical plug number or name of virtual machine" />
- </optional>
- <optional>
- <attribute name="snmp_version" rha:description="Specifies SNMP version to use (1,2c,3)" />
+ <attribute name="ssl" rha:description="SSL connection" />
</optional>
<optional>
- <attribute name="community" rha:description="Set the community string" />
+ <attribute name="inet4_only" rha:description="Forces agent to use IPv4 addresses only" />
</optional>
<optional>
- <attribute name="snmp_auth_prot" rha:description="Set authentication protocol (MD5|SHA)" />
+ <attribute name="inet6_only" rha:description="Forces agent to use IPv6 addresses only" />
</optional>
<optional>
- <attribute name="snmp_sec_level" rha:description="Set security level (noAuthNoPriv|authNoPriv|authPriv)" />
+ <attribute name="ipport" rha:description="TCP port to use for connection with device" />
</optional>
<optional>
- <attribute name="snmp_priv_prot" rha:description="Set privacy protocol (DES|AES)" />
+ <attribute name="port" rha:description="Physical plug number or name of virtual machine" />
</optional>
<optional>
- <attribute name="snmp_priv_passwd" rha:description="Set privacy protocol password" />
+ <attribute name="verbose" rha:description="Verbose mode" />
</optional>
<optional>
- <attribute name="snmp_priv_passwd_script" rha:description="Script to run to retrieve privacy password" />
+ <attribute name="debug" rha:description="Write debug information to given file" />
</optional>
<optional>
- <attribute name="udpport" rha:description="UDP/TCP port to use for connection with device" />
+ <attribute name="version" rha:description="Display version information and exit" />
</optional>
<optional>
- <attribute name="inet4_only" rha:description="Forces agent to use IPv4 addresses only" />
+ <attribute name="help" rha:description="Display help and exit" />
</optional>
<optional>
- <attribute name="inet6_only" rha:description="Forces agent to use IPv6 addresses only" />
+ <attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
<optional>
- <attribute name="verbose" rha:description="Verbose mode" />
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
</optional>
<optional>
- <attribute name="debug" rha:description="Write debug information to given file" />
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
</optional>
<optional>
- <attribute name="version" rha:description="Display version information and exit" />
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
</optional>
<optional>
- <attribute name="help" rha:description="Display help and exit" />
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
</optional>
<optional>
- <attribute name="separator" rha:description="Separator for CSV created by operation list" />
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
</optional>
</group>
+ <!-- No metadata for fence_ibmblade -->
<!-- fence_sanbox2 -->
<group>
@@ -3329,8 +3974,27 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
+ <!-- No metadata for fence_egenera -->
<!-- fence_apc_snmp -->
<group>
@@ -3400,6 +4064,24 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
@@ -3450,6 +4132,24 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="help" rha:description="Display help and exit" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
@@ -3521,6 +4221,24 @@ To validate your cluster.conf against this schema, run:
<optional>
<attribute name="separator" rha:description="Separator for CSV created by operation list" />
</optional>
+ <optional>
+ <attribute name="power_timeout" rha:description="Test X seconds for status change after ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="shell_timeout" rha:description="Wait X seconds for cmd prompt after issuing command" />
+ </optional>
+ <optional>
+ <attribute name="login_timeout" rha:description="Wait X seconds for cmd prompt after login" />
+ </optional>
+ <optional>
+ <attribute name="power_wait" rha:description="Wait X seconds after issuing ON/OFF" />
+ </optional>
+ <optional>
+ <attribute name="retry_on" rha:description="Count of attempts to retry power on" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait X seconds before fencing is started" />
+ </optional>
</group>
<!-- end auto-generated device definitions -->
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e2…
Commit: e2c5e231eb9d6732235a073e2556993891b79e3f
Parent: 77ad746968784f1ede7d79f368ffbf01a7cd75cd
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Thu Feb 3 14:06:01 2011 -0600
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Thu Feb 3 14:11:44 2011 -0600
fenced: update fenced man page with -q option
The new dbus code in fenced can be disabled with the -q command line
option. Add -q option to fenced man page.
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: David Teigland <teigland(a)redhat.com>
---
fence/man/fenced.8 | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fence/man/fenced.8 b/fence/man/fenced.8
index c3496fb..64f26e0 100644
--- a/fence/man/fenced.8
+++ b/fence/man/fenced.8
@@ -142,6 +142,9 @@ All nodes are in a clean state to start. Do no startup fencing.
.B \-s
Skip startup fencing of nodes with no defined fence methods.
.TP
+.B \-q
+Disable dbus signals.
+.TP
.BI \-j " secs"
Post-join fencing delay. Default 6.
.TP
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0f…
Commit: 0f8d260207c686dd683da11b04868c483038a9ef
Parent: 4536bfb712dffa40a0e26910a8977babd902743e
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Thu Feb 3 14:06:01 2011 -0600
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Thu Feb 3 14:06:01 2011 -0600
fenced: update fenced man page with -q option
The new dbus code in fenced can be disabled with the -q command line
option. Add -q option to fenced man page.
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: David Teigland <teigland(a)redhat.com>
---
fence/man/fenced.8 | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fence/man/fenced.8 b/fence/man/fenced.8
index c3496fb..64f26e0 100644
--- a/fence/man/fenced.8
+++ b/fence/man/fenced.8
@@ -142,6 +142,9 @@ All nodes are in a clean state to start. Do no startup fencing.
.B \-s
Skip startup fencing of nodes with no defined fence methods.
.TP
+.B \-q
+Disable dbus signals.
+.TP
.BI \-j " secs"
Post-join fencing delay. Default 6.
.TP
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5c…
Commit: 5cb72e7ab6105f78af396a7e68d19ddaf3d06289
Parent: 04ed614339bb64003f3cc42af9994ff637313618
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Feb 3 12:18:49 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Feb 3 12:18:49 2011 -0600
gfs2_edit: fix segfault in set_bitmap when block is in rgrp
If you called libgfs2 function gfs2_set_bitmap to set a bit but
specified a block outside the data blocks, it would segfault.
rhbz#674843
---
gfs2/libgfs2/fs_bits.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index 7409bed..38ef92c 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -168,7 +168,7 @@ int gfs2_set_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, int state)
rgd = gfs2_blk2rgrpd(sdp, blkno);
- if(!rgd)
+ if(!rgd || blkno < rgd->ri.ri_data0)
return -1;
rgrp_block = (uint32_t)(blkno - rgd->ri.ri_data0);
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=04…
Commit: 04ed614339bb64003f3cc42af9994ff637313618
Parent: 8bad0161fb746d58889758d5d2b0e28ed8e3bcbc
Author: Steven Whitehouse <swhiteho(a)redhat.com>
AuthorDate: Wed Oct 27 10:47:34 2010 +0100
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Feb 3 11:59:04 2011 -0600
gfs2_edit: Fix bitmap editing function
The bitmap editing function wasn't reading in the rgrp, so that it
would fail with a NULL pointer dereference.
rhbz#674843
---
gfs2/edit/hexedit.c | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index c82ddae..abeed18 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2557,28 +2557,28 @@ static void find_change_block_alloc(int *newval)
if (ablock == sbd.sb_addr)
printf("3 (the superblock is not in the bitmap)\n");
else {
- if (newval) {
- if (gfs2_set_bitmap(&sbd, ablock, *newval))
- printf("-1 (block invalid or part of an rgrp).\n");
- else
- printf("%d\n", *newval);
- } else {
- rgd = gfs2_blk2rgrpd(&sbd, ablock);
- if (rgd) {
- gfs2_rgrp_read(&sbd, rgd);
+ rgd = gfs2_blk2rgrpd(&sbd, ablock);
+ if (rgd) {
+ gfs2_rgrp_read(&sbd, rgd);
+ if (newval) {
+ if (gfs2_set_bitmap(&sbd, ablock, *newval))
+ printf("-1 (block invalid or part of an rgrp).\n");
+ else
+ printf("%d\n", *newval);
+ } else {
type = gfs2_get_bitmap(&sbd, ablock, rgd);
- gfs2_rgrp_relse(rgd);
if (type < 0) {
printf("-1 (block invalid or part of "
"an rgrp).\n");
exit(-1);
}
printf("%d (%s)\n", type, allocdesc[gfs1][type]);
- } else {
- gfs2_rgrp_free(&sbd.rglist);
- printf("-1 (block invalid or part of an rgrp).\n");
- exit(-1);
}
+ gfs2_rgrp_relse(rgd);
+ } else {
+ gfs2_rgrp_free(&sbd.rglist);
+ printf("-1 (block invalid or part of an rgrp).\n");
+ exit(-1);
}
}
gfs2_rgrp_free(&sbd.rglist);
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=57…
Commit: 578af431fb74985e39ba8c3acf43459bd476947f
Parent: 0bfad0d0504aa0c2a2cfa973d79367f3208f8c04
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Feb 3 10:35:37 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Feb 3 11:32:27 2011 -0600
gfs2_edit: Fix error message on blockalloc when outside bitmap
If you specify gfs2_edit <block> blockalloc X and the block is
part of the rgrp or bitmaps, it was not giving a proper error
message. This patch adds an error message.
rhbz#674843
---
gfs2/edit/hexedit.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index bb59758..2a88a40 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2568,6 +2568,11 @@ static void find_change_block_alloc(int *newval)
gfs2_rgrp_read(&sbd, rgd);
type = gfs2_get_bitmap(&sbd, ablock, rgd);
gfs2_rgrp_relse(rgd);
+ if (type < 0) {
+ printf("-1 (block invalid or part of "
+ "an rgrp).\n");
+ exit(-1);
+ }
printf("%d (%s)\n", type, allocdesc[gfs1][type]);
} else {
gfs2_rgrp_free(&sbd.rglist);
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d7…
Commit: d7f914ed829bdcddbc69fcc0c152142d12f3cd1b
Parent: 87f0950748b045b50e7ce18a8baf6e0ac81a1492
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Feb 3 08:13:35 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Feb 3 11:27:02 2011 -0600
gfs2_edit: has problems printing gfs1 journals
The gfs2_edit tool was releasing the buffer too soon while printing out
journals. It worked for gfs2 journals, but not for gfs1 journals. This
patch moves the buffer release later in the function so that gfs1 journals
will print correctly.
rhbz#674843
---
gfs2/edit/hexedit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 4fc8a43..fd12c0d 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2023,7 +2023,6 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size)
if (!gfs1)
do_dinode_extended(&di, jindex_bh); /* parse dir. */
- brelse(jindex_bh);
if (gfs1) {
struct gfs2_inode *jiinode;
@@ -2048,6 +2047,7 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size)
*j_size = jdi.di_size;
brelse(j_bh);
}
+ brelse(jindex_bh);
return jblock;
}
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: 897437313adc8801b38ea42abc4fd07bd486ce3e
Parent: 7acf4bd2e7176cabf87d47f0c4d8677f99e08544
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Feb 3 12:18:49 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Feb 3 12:27:44 2011 -0600
gfs2_edit: fix segfault in set_bitmap when block is in rgrp
If you called libgfs2 function gfs2_set_bitmap to set a bit but
specified a block outside the data blocks, it would segfault.
rhbz#674843
---
gfs2/libgfs2/fs_bits.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index 7d37d57..97172df 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -170,7 +170,7 @@ int gfs2_set_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, int state)
rgd = gfs2_blk2rgrpd(sdp, blkno);
- if(!rgd)
+ if(!rgd || blkno < rgd->ri.ri_data0)
return -1;
rgrp_block = (uint32_t)(blkno - rgd->ri.ri_data0);
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: bdaaf3f4ef1a3df196bb900ec7ade2017362569b
Parent: 2e5a1389b93b17013445bda32824fb8638bc8d74
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Feb 3 10:35:37 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Feb 3 10:35:37 2011 -0600
gfs2_edit: Fix error message on blockalloc when outside bitmap
If you specify gfs2_edit <block> blockalloc X and the block is
part of the rgrp or bitmaps, it was not giving a proper error
message. This patch adds an error message.
rhbz#674843
---
gfs2/edit/hexedit.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 27dbd9d..ea3ad28 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2569,6 +2569,11 @@ static void find_change_block_alloc(int *newval)
printf("%d\n", *newval);
} else {
type = gfs2_get_bitmap(&sbd, ablock, rgd);
+ if (type < 0) {
+ printf("-1 (block invalid or part of "
+ "an rgrp).\n");
+ exit(-1);
+ }
printf("%d (%s)\n", type, allocdesc[gfs1][type]);
}
gfs2_rgrp_relse(rgd);
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: c81702e92ff710c3c12ccca13e8c30eff269427f
Parent: dde989e50401270fbfd8882c10e44e401afd78ec
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Feb 3 08:13:35 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Feb 3 08:13:35 2011 -0600
gfs2_edit: has problems printing gfs1 journals
The gfs2_edit tool was releasing the buffer too soon while printing out
journals. It worked for gfs2 journals, but not for gfs1 journals. This
patch moves the buffer release later in the function so that gfs1 journals
will print correctly.
rhbz#656371
---
gfs2/edit/hexedit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 13d432f..aa49d50 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2025,7 +2025,6 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size)
if (!gfs1)
do_dinode_extended(&di, jindex_bh); /* parse dir. */
- brelse(jindex_bh);
if (gfs1) {
struct gfs2_inode *jiinode;
@@ -2050,6 +2049,7 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size)
*j_size = jdi.di_size;
brelse(j_bh);
}
+ brelse(jindex_bh);
return jblock;
}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=be…
Commit: bedaeebc12fac2e5568249357835f210174f4240
Parent: 8fde4dae1ee517ca1f2ce2c48d006797e59e923e
Author: Chris Feist <cfeist(a)redhat.com>
AuthorDate: Tue Feb 1 14:15:04 2011 -0600
Committer: Chris Feist <cfeist(a)redhat.com>
CommitterDate: Wed Feb 2 16:04:36 2011 -0600
cman: Added checkquorum script for self fencing
A checkquorum script has been added which when copied to the
/etc/watchdog.d directory will cause the machine to node to reboot
itself if it has lost quorum for ~60 seconds.
Resolves: rhbz#560700
---
cman/Makefile | 2 +-
cman/man/Makefile | 3 +-
cman/man/checkquorum.8 | 29 ++++++++++++++
cman/scripts/Makefile | 10 +++++
cman/scripts/checkquorum | 97 ++++++++++++++++++++++++++++++++++++++++++++++
make/install.mk | 4 ++
6 files changed, 143 insertions(+), 2 deletions(-)
diff --git a/cman/Makefile b/cman/Makefile
index ead0baa..1cf8bc9 100644
--- a/cman/Makefile
+++ b/cman/Makefile
@@ -1,4 +1,4 @@
include ../make/defines.mk
include $(OBJDIR)/make/passthrough.mk
-SUBDIRS=lib cman_tool daemon qdisk notifyd init.d man
+SUBDIRS=lib cman_tool daemon qdisk notifyd init.d man scripts
diff --git a/cman/man/Makefile b/cman/man/Makefile
index df20abb..f7fbebf 100644
--- a/cman/man/Makefile
+++ b/cman/man/Makefile
@@ -5,7 +5,8 @@ MANTARGET= \
qdiskd.8 \
mkqdisk.8 \
cmannotifyd.8 \
- cman_notify.8
+ cman_notify.8 \
+ checkquorum.8
include ../../make/defines.mk
include $(OBJDIR)/make/install.mk
diff --git a/cman/man/checkquorum.8 b/cman/man/checkquorum.8
new file mode 100644
index 0000000..96f61f0
--- /dev/null
+++ b/cman/man/checkquorum.8
@@ -0,0 +1,29 @@
+.TH "checkquorum" "8" "February 2011" "" "Check Quorum Watchdog Script"
+.SH "NAME"
+checkquorum \- Check Quorum Watchdog Script
+.SH "SYNOPSIS"
+\fBcheckquorum
+.SH "DESCRIPTION"
+.PP
+The \fBcheckquorum\fP watchdog script, when copied to the
+.IR /etc/watchdog.d
+directory and after enabling/starting the watchdog daemon causes the node to reboot if quorum is
+lost and not regained within a user configurable amount of time (default: 60 seconds).
+.SH "OPTIONS"
+The checkquorum script includes several options which can be set by editing
+the script with a text editor.
+.TP
+.BR $wait_time
+Amount of time in seconds to wait after quorum is lost before trigger a reboot
+(Default: 60 seconds).
+.TP
+.BR $hardreboot
+Instantly reboot the machine without cleanly shutting down the system.
+Useful when the machine may hang on reboot. Set to 1 to hard reboot the
+system, 0 to do a normal reboot.
+.SH "NOTES"
+\fBcheckquorum\fP should never be called outside of watchdog except for
+debugging purposes.
+
+.SH "SEE ALSO"
+watchdog(8)
diff --git a/cman/scripts/Makefile b/cman/scripts/Makefile
new file mode 100644
index 0000000..b4866c8
--- /dev/null
+++ b/cman/scripts/Makefile
@@ -0,0 +1,10 @@
+SHAREDIRTEX=checkquorum
+
+include ../../make/defines.mk
+include $(OBJDIR)/make/clean.mk
+include $(OBJDIR)/make/install.mk
+include $(OBJDIR)/make/uninstall.mk
+
+all:
+
+clean: generalclean
diff --git a/cman/scripts/checkquorum b/cman/scripts/checkquorum
new file mode 100755
index 0000000..43cbc6d
--- /dev/null
+++ b/cman/scripts/checkquorum
@@ -0,0 +1,97 @@
+#!/usr/bin/perl -w
+# Quorum detection watchdog script
+#
+# This script will return -2 if the node had quorum at one point
+# and then subsequently lost it
+#
+# Copyright 2011 Red Hat, Inc.
+
+# Amount of time in seconds to wait after quorum is lost to fail script
+$wait_time = 60;
+
+# Hard Reboot the system (doesn't cleanly shut down the system)
+$hardreboot = 0;
+
+# Location of temporary file to capture timeouts
+$timerfile = "/var/run/cluster/checkquorum-timer";
+
+# Enable debug messages (0 to disable, 1 to enable)
+$debugval = 0;
+
+# If command is called attempting to 'repair' we automatically fail
+if (($#ARGV != -1) && ($ARGV[0] eq "repair")) {
+ debug ("Failing on repair\n");
+ exit 1;
+}
+
+if (!quorum()) {
+ if (has_quorum_already_been_formed()) {
+ debug("Quorum has already existed, node can be self fenced!\n");
+ if (-e $timerfile) {
+ $tf = open (FILE, "$timerfile");
+ $time = <FILE>;
+ close (FILE);
+ $timediff = time() - $time;
+ if ($timediff >= $wait_time) {
+ self_fence()
+ } else {
+ $remaining = $wait_time - $timediff;
+ debug("Time has not exceeded wait time ($remaining seconds remaining).\n");
+ }
+ } else {
+ debug("Creating timer file...\n");
+ $tf = open (FILE, ">$timerfile");
+ print FILE time();
+ close (FILE);
+ }
+ } else {
+ debug("This is a new startup no self-fencing will occur.\n");
+ `rm -f $timerfile`;
+ }
+} else {
+ debug("Quorum exists, no self-fencing should occur.\n");
+ `rm -f $timerfile`;
+}
+
+sub has_quorum_already_been_formed {
+ $oe = `/usr/sbin/corosync-objctl 2>&1 | grep -E "runtime.totem.pg.mrp.srp.operational_entered|Could not initialize objdb library|Cannot connect to quorum service" `;
+ if ($oe =~ /^Could not/ || $oe =~ /^Cannot/) {
+ debug("corosync is not running\n");
+ exit 0;
+ }
+ $oe =~ s/.*=//;
+ if ($oe > 1) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub quorum {
+ $cq = `corosync-quorumtool -s 2>&1 | grep -E "Quorate:|Cannot connect to quorum service"`;
+ if ($cq =~ /Cannot connect to quorum service/) {
+ debug("corosync is not running\n");
+ exit 0;
+ }
+ $cq =~ s/Quorate: *//;
+ chomp ($cq);
+ return 1 if ($cq eq "Yes");
+ return 0;
+}
+
+sub self_fence {
+ debug("Self fencing commencing...\n");
+ `rm -f $timerfile`;
+ if ($hardreboot == 1) {
+ `echo 1 > /proc/sys/kernel/sysrq`;
+ `echo b > /proc/sysrq-trigger`;
+ }
+ exit -2;
+}
+
+sub debug {
+ $out = pop(@_);
+ if ($debugval) {
+ print $out;
+ }
+}
diff --git a/make/install.mk b/make/install.mk
index 8e1bcd6..823184b 100644
--- a/make/install.mk
+++ b/make/install.mk
@@ -78,6 +78,10 @@ ifdef PKGCONF
install -d ${pkgconfigdir}
install -m644 ${PKGCONF} ${pkgconfigdir}
endif
+ifdef SHAREDIRTEX
+ install -d ${sharedir}
+ install -m755 ${SHAREDIRTEX} ${sharedir}
+endif
ifdef SHAREDIRT
install -d ${sharedir}
install -m644 ${SHAREDIRT} ${sharedir}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=52…
Commit: 524dca1221b851159bf45a702f111bd8952036d7
Parent: 4b4addea8835006a57ab1f8bf6ee9746b2b96e19
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed Feb 2 13:29:22 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Feb 2 14:36:09 2011 -0600
gfs2_edit: has problems printing gfs1 journals
The gfs2_edit tool was releasing the buffer too soon while printing out
journals. It worked for gfs2 journals, but not for gfs1 journals. This
patch moves the buffer release later in the function so that gfs1 journals
will print correctly.
rhbz#656371
---
gfs2/edit/hexedit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 6b92390..5432fa2 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2038,7 +2038,6 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size)
if (!gfs1)
do_dinode_extended(&di, jindex_bh); /* parse dir. */
- brelse(jindex_bh);
if (gfs1) {
struct gfs2_inode *jiinode;
@@ -2063,6 +2062,7 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size)
*j_size = jdi.di_size;
brelse(j_bh);
}
+ brelse(jindex_bh);
return jblock;
}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ff…
Commit: ff658f227fa956f1f8e68d37ae49579960358cbd
Parent: 45b63600a8cc8836f48f580192ced51d0e2f3f7b
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Dec 13 10:58:28 2010 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Feb 2 14:36:09 2011 -0600
gfs2_edit: Fix memory leak in savemeta option
The savemeta option of gfs2_edit was not releasing its buffers
after they were used, so they kept accumulating in memory.
In large file systems, it was nearly impossible to save the metadata
because it would run out of memory and start swapping to disk.
rhbz#656371
---
gfs2/edit/savemeta.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index fbc1f4f..7c28ae9 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -46,7 +46,6 @@ struct saved_metablock {
};
struct saved_metablock *savedata;
-struct gfs2_buffer_head *savebh;
uint64_t last_fs_block, last_reported_block, blks_saved, total_out, pct;
uint64_t journal_blocks[MAX_JOURNALS_SAVED];
uint64_t gfs1_journal_size = 0; /* in blocks */
@@ -212,6 +211,7 @@ static int save_block(int fd, int out_fd, uint64_t blk)
int blktype, blklen, outsz;
uint16_t trailing0;
char *p;
+ struct gfs2_buffer_head *savebh;
if (blk > last_fs_block) {
fprintf(stderr, "\nWarning: bad block pointer '0x%llx' "
@@ -230,8 +230,10 @@ static int save_block(int fd, int out_fd, uint64_t blk)
inode, not the block within the inode "blk". They may or may not
be the same thing. */
if (get_gfs_struct_info(savebh, &blktype, &blklen) &&
- !block_is_systemfile())
+ !block_is_systemfile()) {
+ brelse(savebh);
return 0; /* Not metadata, and not system file, so skip it */
+ }
trailing0 = 0;
p = &savedata->buf[blklen - 1];
while (*p=='\0' && trailing0 < sbd.bsize) {
@@ -246,6 +248,7 @@ static int save_block(int fd, int out_fd, uint64_t blk)
do_write(out_fd, savedata->buf, outsz);
total_out += sizeof(savedata->blk) + sizeof(savedata->siglen) + outsz;
blks_saved++;
+ brelse(savebh);
return blktype;
}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8f…
Commit: 8fde4dae1ee517ca1f2ce2c48d006797e59e923e
Parent: d100504de6eff5f83dba79319ad0bd560f7a57df
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed Feb 2 08:08:53 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Feb 2 09:35:37 2011 -0600
fsck.gfs2: can't repair rgrps resulting from gfs_grow->gfs2_convert
This patch expands the algorithm that repairs destroyed resource
groups. It adds more levels of checking and is able to determine
the locations of resource groups that are not evenly spaced.
rhbz#576640
---
gfs2/edit/savemeta.c | 10 +-
gfs2/fsck/fsck.h | 5 +-
gfs2/fsck/initialize.c | 32 ++-
gfs2/fsck/main.c | 3 +-
gfs2/fsck/metawalk.c | 6 +-
gfs2/fsck/pass2.c | 12 +
gfs2/fsck/rgrepair.c | 645 +++++++++++++++++++++++++++++++++++---------
gfs2/libgfs2/fs_geometry.c | 5 +-
gfs2/libgfs2/libgfs2.h | 2 +
gfs2/libgfs2/rgrp.c | 17 +-
gfs2/libgfs2/super.c | 4 +-
gfs2/mkfs/main_grow.c | 2 +-
12 files changed, 598 insertions(+), 145 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 10658a2..655a3bc 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -201,7 +201,7 @@ static int save_block(int fd, int out_fd, uint64_t blk)
if (blk > last_fs_block) {
fprintf(stderr, "\nWarning: bad block pointer '0x%llx' "
- "ignored in block (block %llu (%llx))",
+ "ignored in block (block %llu (0x%llx))",
(unsigned long long)blk,
(unsigned long long)block, (unsigned long long)block);
return 0;
@@ -322,7 +322,9 @@ static void save_indirect_blocks(int out_fd, osi_list_t *cur_list,
if (height != hgt) { /* If not at max height */
nbh = bread(&sbd, indir_block);
osi_list_add_prev(&nbh->b_altlist, cur_list);
- brelse(nbh);
+ /* The buffer_head needs to be queued ahead, so
+ don't release it!
+ brelse(nbh);*/
}
} /* for all data on the indirect block */
}
@@ -368,8 +370,8 @@ static void save_inode_data(int out_fd)
(S_ISDIR(inode->i_di.di_mode) ||
(gfs1 && inode->i_di.__pad1 == GFS_FILE_DIR)))
height++;
- else if (height && !block_is_systemfile() &&
- !S_ISDIR(inode->i_di.di_mode))
+ else if (height && !(inode->i_di.di_flags & GFS2_DIF_SYSTEM) &&
+ !block_is_systemfile() && !S_ISDIR(inode->i_di.di_mode))
height--;
osi_list_add(&metabh->b_altlist, &metalist[0]);
for (i = 1; i <= height; i++){
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index b0e1efc..bc14b88 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -84,9 +84,12 @@ enum rgindex_trust_level { /* how far can we trust our RG index? */
open_minded = 2, /* At least 1 RG is corrupt. Try to calculate what it
should be, in a perfect world where our RGs are all
on even boundaries. Blue sky. Chirping birds. */
- distrust = 3 /* The world isn't perfect, our RGs are not on nice neat
+ distrust = 3, /* The world isn't perfect, our RGs are not on nice neat
boundaries. The fs must have been messed with by
gfs2_grow or something. Count the RGs by hand. */
+ indignation = 4 /* Not only do we have corruption, but the rgrps
+ aren't on even boundaries, so this file system
+ must have been converted from gfs2_convert. */
};
extern struct gfs2_inode *fsck_load_inode(struct gfs2_sbd *sbp, uint64_t block);
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 14cc9f6..469f022 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -143,7 +143,8 @@ static int set_block_ranges(struct gfs2_sbd *sdp)
{
rgd = osi_list_entry(tmp, struct rgrp_list, list);
ri = &rgd->ri;
- if (ri->ri_data0 + ri->ri_data - 1 > rmax)
+ if (ri->ri_data0 + ri->ri_data &&
+ ri->ri_data0 + ri->ri_data - 1 > rmax)
rmax = ri->ri_data0 + ri->ri_data - 1;
if (!rmin || ri->ri_data0 < rmin)
rmin = ri->ri_data0;
@@ -402,6 +403,20 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
int rgcount, sane = 1;
enum rgindex_trust_level trust_lvl;
uint64_t addl_mem_needed;
+ const char *level_desc[] = {
+ _("Checking if all rgrp and rindex values are good"),
+ _("Checking if rindex values are ascending and evenly spaced"),
+ _("Calculating where the rgrps should be if evenly spaced"),
+ _("Trying to rebuild rindex assuming evenly spaced rgrps"),
+ _("Trying to rebuild rindex assuming unevenly spaced rgrps"),
+ };
+ const char *fail_desc[] = {
+ _("Some damage was found; we need to take remedial measures"),
+ _("rindex is unevenly spaced: converted from gfs1 or corrupt"),
+ _("rindex calculations don't match: uneven rgrp boundaries"),
+ _("Too many rgrp misses: rgrps must be unevenly spaced"),
+ _("Too much damage found: we cannot rebuild this rindex"),
+ };
/*******************************************************************
****************** Initialize important inodes ******************
@@ -442,18 +457,23 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
******** Validate and read in resource group information ********
*******************************************************************/
log_warn( _("Validating Resource Group index.\n"));
- for (trust_lvl = blind_faith; trust_lvl <= distrust; trust_lvl++) {
- log_warn( _("Level %d RG check.\n"), trust_lvl + 1);
+ for (trust_lvl = blind_faith; trust_lvl <= indignation; trust_lvl++) {
+ log_warn( _("Level %d rgrp check: %s.\n"), trust_lvl + 1,
+ level_desc[trust_lvl]);
if ((rg_repair(sdp, trust_lvl, &rgcount, &sane) == 0) &&
(ri_update(sdp, 0, &rgcount, &sane) == 0)) {
log_warn( _("(level %d passed)\n"), trust_lvl + 1);
break;
}
else
- log_err( _("(level %d failed)\n"), trust_lvl + 1);
+ log_err( _("(level %d failed: %s)\n"), trust_lvl + 1,
+ fail_desc[trust_lvl]);
+ if (fsck_abort)
+ break;
}
- if (trust_lvl > distrust) {
- log_err( _("RG recovery impossible; I can't fix this file system.\n"));
+ if (trust_lvl > indignation) {
+ log_err( _("Resource Group recovery impossible; I can't fix "
+ "this file system.\n"));
return -1;
}
log_info( _("%u resource groups found.\n"), rgcount);
diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c
index 222219f..c68e3da 100644
--- a/gfs2/fsck/main.c
+++ b/gfs2/fsck/main.c
@@ -334,7 +334,8 @@ int main(int argc, char **argv)
error = FSCK_CANCELED;
}
- check_statfs(sbp);
+ if (!fsck_abort)
+ check_statfs(sbp);
/* Free up our system inodes */
inode_put(&sbp->md.inum);
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index ff348e4..cffff8a 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -35,7 +35,7 @@ int check_n_fix_bitmap(struct gfs2_sbd *sdp, uint64_t blk,
old_bitmap_state = gfs2_get_bitmap(sdp, blk, rgd);
if (old_bitmap_state < 0) {
- log_err( _("Block %lld (0x%llx) is not represented in the"
+ log_err( _("Block %lld (0x%llx) is not represented in the "
"system bitmap; part of an rgrp or superblock.\n"),
(unsigned long long)blk, (unsigned long long)blk);
return -1;
@@ -726,6 +726,10 @@ static int check_leaf_blks(struct gfs2_inode *ip, struct metawalk_fxns *pass)
if (pass->check_dentry && S_ISDIR(ip->i_di.di_mode)) {
error = check_entries(ip, lbh, DIR_EXHASH,
&count, pass);
+
+ if (skip_this_pass || fsck_abort)
+ return 0;
+
if(error < 0) {
stack;
brelse(lbh);
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 35acba4..90c6940 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -544,6 +544,8 @@ static int check_system_dir(struct gfs2_inode *sysinode, const char *dirname,
}
}
error = check_dir(sysinode->i_sbd, iblock, &pass2_fxns);
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
if(error < 0) {
stack;
return -1;
@@ -654,18 +656,26 @@ int pass2(struct gfs2_sbd *sbp)
stack;
return FSCK_ERROR;
}
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
if (check_system_dir(sbp->md.pinode, "per_node", build_per_node)) {
stack;
return FSCK_ERROR;
}
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
if (check_system_dir(sbp->master_dir, "master", build_master)) {
stack;
return FSCK_ERROR;
}
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
if (check_system_dir(sbp->md.rooti, "root", build_root)) {
stack;
return FSCK_ERROR;
}
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
log_info( _("Checking directory inodes.\n"));
/* Grab each directory inode, and run checks on it */
for(dirblk = 0; dirblk < last_fs_block; dirblk++) {
@@ -699,6 +709,8 @@ int pass2(struct gfs2_sbd *sbp)
}
}
error = check_dir(sbp, dirblk, &pass2_fxns);
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
if(error < 0) {
stack;
return FSCK_ERROR;
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 705ba86..af5a02d 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -15,6 +15,9 @@
int rindex_modified = FALSE;
struct special_blocks false_rgrps;
+#define BAD_RG_PERCENT_TOLERANCE 11
+#define AWAY_FROM_BITMAPS 0x1000
+
#define ri_equal(ondisk, expected, field) (ondisk.field == expected.field)
#define ri_compare(rg, ondisk, expected, field, fmt) \
@@ -47,7 +50,7 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
osi_list_init(&false_rgrps.list);
for (j = 0; j < sdp->md.journals; j++) {
- log_debug( _("Checking for RGs in journal%d.\n"), j);
+ log_debug( _("Checking for rgrps in journal%d.\n"), j);
ip = sdp->md.journal[j];
jblocks = ip->i_di.di_size / sdp->sd_sb.sb_bsize;
for (b = 0; b < jblocks; b++) {
@@ -56,7 +59,7 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
break;
bh = bread(sdp, dblock);
if (!gfs2_check_meta(bh, GFS2_METATYPE_RG)) {
- log_debug( _("False RG found at block "
+ log_debug( _("False rgrp found at block "
"0x%" PRIx64 "\n"), dblock);
gfs2_special_set(&false_rgrps, dblock);
}
@@ -73,66 +76,37 @@ static int is_false_rg(uint64_t block)
}
/*
- * gfs2_rindex_rebuild - rebuild a corrupt Resource Group (RG) index manually
- * where trust_lvl == distrust
- *
- * If this routine is called, it means we have RGs in odd/unexpected places,
- * and there is a corrupt RG or RG index entry. It also means we can't trust
- * the RG index to be sane, and the RGs don't agree with how mkfs would have
- * built them by default. So we have no choice but to go through and count
- * them by hand. We've tried twice to recover the RGs and RG index, and
- * failed, so this is our last chance to remedy the situation.
- *
- * This routine tries to minimize performance impact by:
- * 1. Skipping through the filesystem at known increments when possible.
- * 2. Shuffle through every block when RGs are not found at the predicted
- * locations.
- *
- * Note: A GFS2 filesystem differs from a GFS1 file system in that there will
- * only be ONE chunk (i.e. no artificial subdevices on either size of the
- * journals). The journals and even the rindex are kept as part of the file
- * system, so we need to rebuild that information by hand. Also, with GFS1,
- * the different chunks ("subdevices") could have different RG sizes, which
- * made for quite a mess when trying to recover RGs. GFS2 always uses the
- * same RG size determined by the original mkfs, so recovery is easier.
+ * find_shortest_rgdist - hunt and peck for the shortest distance between RGs.
*
+ * Sample several of them because an RG that's been blasted may
+ * look like twice the distance. If we can find 6 of them, that
+ * should be enough to figure out the correct layout.
+ * This also figures out first_rg_dist since that's always different.
*/
-static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
- int *num_rgs)
+static uint64_t find_shortest_rgdist(struct gfs2_sbd *sdp,
+ uint64_t *initial_first_rg_dist,
+ uint64_t *first_rg_dist)
{
+ uint64_t blk, block_of_last_rg, shortest_dist_btwn_rgs;
struct gfs2_buffer_head *bh;
- uint64_t shortest_dist_btwn_rgs;
- uint64_t blk, block_of_last_rg;
- uint64_t fwd_block, block_bump;
- uint64_t first_rg_dist, initial_first_rg_dist;
- struct rgrp_list *calc_rgd, *prev_rgd;
- int number_of_rgs, rgi;
+ int number_of_rgs = 0;
struct gfs2_rindex buf, tmpndx;
- int rg_was_fnd = FALSE, corrupt_rgs = 0, bitmap_was_fnd;
- osi_list_t *tmp;
/* Figure out if there are any RG-looking blocks in the journal we
need to ignore. */
find_journaled_rgs(sdp);
- osi_list_init(ret_list);
- number_of_rgs = 0;
- initial_first_rg_dist = first_rg_dist = sdp->sb_addr + 1;
+
+ *initial_first_rg_dist = *first_rg_dist = sdp->sb_addr + 1;
block_of_last_rg = sdp->sb_addr + 1;
- /* ------------------------------------------------------------- */
- /* First, hunt and peck for the shortest distance between RGs. */
- /* Sample several of them because an RG that's been blasted may */
- /* look like twice the distance. If we can find 6 of them, that */
- /* should be enough to figure out the correct layout. */
- /* ------------------------------------------------------------- */
shortest_dist_btwn_rgs = sdp->device.length;
+
for (blk = sdp->sb_addr + 1;
- blk < sdp->device.length && number_of_rgs < 6;
- blk++) {
+ blk < sdp->device.length && number_of_rgs < 6; blk++) {
bh = bread(sdp, blk);
if (((blk == sdp->sb_addr + 1) ||
(!gfs2_check_meta(bh, GFS2_METATYPE_RG))) &&
!is_false_rg(blk)) {
- log_debug( _("RG found at block 0x%" PRIx64 "\n"), blk);
+ log_debug( _("rgrp found at block 0x%" PRIx64 "\n"), blk);
if (blk > sdp->sb_addr + 1) {
uint64_t rgdist;
@@ -149,8 +123,8 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
/* from the rest because of the superblock */
/* and 64K dead space. */
/* ----------------------------------------- */
- if (first_rg_dist == initial_first_rg_dist)
- first_rg_dist = rgdist;
+ if (*first_rg_dist == *initial_first_rg_dist)
+ *first_rg_dist = rgdist;
if (rgdist < shortest_dist_btwn_rgs) {
shortest_dist_btwn_rgs = rgdist;
log_debug( _("(shortest so far)\n"));
@@ -164,18 +138,15 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
}
brelse(bh);
}
- number_of_rgs = 0;
- gfs2_special_free(&false_rgrps);
-
/* -------------------------------------------------------------- */
/* Sanity-check our first_rg_dist. If RG #2 got nuked, the */
/* first_rg_dist would measure from #1 to #3, which would be bad. */
/* We need to take remedial measures to fix it (from the index). */
/* -------------------------------------------------------------- */
- log_debug( _("First RG distance: 0x%" PRIx64 "\n"), first_rg_dist);
- log_debug( _("Distance between RGs: 0x%" PRIx64 "\n"),
+ log_debug( _("First rgrp distance: 0x%" PRIx64 "\n"), *first_rg_dist);
+ log_debug( _("Distance between rgrps: 0x%" PRIx64 "\n"),
shortest_dist_btwn_rgs);
- if (first_rg_dist >= shortest_dist_btwn_rgs +
+ if (*first_rg_dist >= shortest_dist_btwn_rgs +
(shortest_dist_btwn_rgs / 4)) {
/* read in the second RG index entry for this subd. */
gfs2_readi(sdp->md.riinode, (char *)&buf,
@@ -183,28 +154,302 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
sizeof(struct gfs2_rindex));
gfs2_rindex_in(&tmpndx, (char *)&buf);
if (tmpndx.ri_addr > sdp->sb_addr + 1) { /* sanity check */
- log_warn( _("RG 2 is damaged: getting dist from index: "));
- first_rg_dist = tmpndx.ri_addr - (sdp->sb_addr + 1);
- log_warn("0x%" PRIx64 "\n", first_rg_dist);
+ log_warn( _("rgrp 2 is damaged: getting dist from index: "));
+ *first_rg_dist = tmpndx.ri_addr - (sdp->sb_addr + 1);
+ log_warn("0x%" PRIx64 "\n", *first_rg_dist);
}
else {
- log_warn( _("RG index 2 is damaged: extrapolating dist: "));
- first_rg_dist = sdp->device.length -
+ log_warn( _("rgrp index 2 is damaged: extrapolating dist: "));
+ *first_rg_dist = sdp->device.length -
(sdp->rgrps - 1) *
(sdp->device.length / sdp->rgrps);
- log_warn("0x%" PRIx64 "\n", first_rg_dist);
+ log_warn("0x%" PRIx64 "\n", *first_rg_dist);
}
- log_debug( _("Adjusted first RG distance: 0x%" PRIx64 "\n"),
- first_rg_dist);
+ log_debug( _("Adjusted first rgrp distance: 0x%" PRIx64 "\n"),
+ *first_rg_dist);
} /* if first RG distance is within tolerance */
+
+ gfs2_special_free(&false_rgrps);
+ return shortest_dist_btwn_rgs;
+}
+
+/*
+ * count_usedspace - count the used bits in a rgrp bitmap buffer
+ */
+static uint64_t count_usedspace(struct gfs2_sbd *sdp, int first,
+ struct gfs2_buffer_head *bh)
+{
+ int off, x, y, bytes_to_check;
+ uint32_t rg_used = 0;
+ unsigned int state;
+
+ /* Count up the free blocks in the bitmap */
+ off = (first) ? sizeof(struct gfs2_rgrp) :
+ sizeof(struct gfs2_meta_header);
+ bytes_to_check = sdp->bsize - off;
+ for (x = 0; x < bytes_to_check; x++) {
+ unsigned char *byte;
+
+ byte = (unsigned char *)&bh->b_data[off + x];
+ if (*byte == 0x55) {
+ rg_used += GFS2_NBBY;
+ continue;
+ }
+ if (*byte == 0x00)
+ continue;
+ for (y = 0; y < GFS2_NBBY; y++) {
+ state = (*byte >> (GFS2_BIT_SIZE * y)) & GFS2_BIT_MASK;
+ if (state == GFS2_BLKST_FREE ||
+ state == GFS2_BLKST_UNLINKED)
+ continue;
+ rg_used++;
+ }
+ }
+ return rg_used;
+}
+
+/*
+ * find_next_rgrp_dist - find the distance to the next rgrp
+ *
+ * This function is only called if the rgrps are determined to be on uneven
+ * boundaries. In a normal gfs2 file system, after mkfs.gfs2, all the
+ * rgrps but the first and second one will be the same distance from the
+ * previous rgrp. (The first rgrp will predictably be after the superblock
+ * and the second one will be adjusted based on the number 64KB skipped
+ * at the start of the file system.) The only way we can deviate from that
+ * pattern is if the user did gfs_grow on a gfs1 file system, then converted
+ * it to gfs2 using gfs2_convert.
+ *
+ * This function finds the distance to the next rgrp for these cases.
+ */
+static uint64_t find_next_rgrp_dist(struct gfs2_sbd *sdp, uint64_t blk,
+ struct rgrp_list *prevrgd)
+{
+ uint64_t rgrp_dist = 0, used_blocks, block, next_block, twogigs;
+ osi_list_t *tmp;
+ struct rgrp_list *rgd = NULL, *next_rgd;
+ struct gfs2_buffer_head *bh;
+ struct gfs2_meta_header mh;
+ int first, length, b, found, mega_in_blocks;
+ uint32_t free_blocks;
+
+ for (tmp = sdp->rglist.next; tmp != &sdp->rglist; tmp = tmp->next) {
+ rgd = osi_list_entry(tmp, struct rgrp_list, list);
+ if (rgd->ri.ri_addr == blk)
+ break;
+ }
+ if (rgd && tmp && tmp != &sdp->rglist && tmp->next &&
+ rgd->ri.ri_addr == blk) {
+ tmp = tmp->next;
+ next_rgd = osi_list_entry(tmp, struct rgrp_list, list);
+ rgrp_dist = next_rgd->ri.ri_addr - rgd->ri.ri_addr;
+ return rgrp_dist;
+ }
+ mega_in_blocks = (1024 * 1024) / sdp->bsize;
+ twogigs = 2048 * mega_in_blocks;
+ /* Unfortunately, if we fall through to here we can't trust the
+ rindex. So we have to analyze the current rgrp to figure out
+ the bare minimum block number where it ends. If we don't have
+ rindex, all we know about this rgrp is what's on disk: its
+ rg_free. If we analyze the rgrp's bitmap and the bitmaps that
+ follow, we can figure out how many bits are used. If we add
+ rg_free, we get the total number of blocks this rgrp
+ represents. After that should be the next rgrp, but it may
+ skip a few blocks (hopefully no more than 4). */
+ used_blocks = 0;
+ length = 0;
+ block = prevrgd->ri.ri_addr;
+ first = 1;
+ found = 0;
+ while (1) {
+ if (block >= sdp->device.length)
+ break;
+ if (block >= prevrgd->ri.ri_addr + twogigs)
+ break;
+ bh = bread(sdp, block);
+ gfs2_meta_header_in(&mh, bh);
+ if ((mh.mh_magic != GFS2_MAGIC) ||
+ (first && mh.mh_type != GFS2_METATYPE_RG) ||
+ (!first && mh.mh_type != GFS2_METATYPE_RB)) {
+ brelse(bh);
+ break;
+ }
+ if (first) {
+ struct gfs2_rgrp *rg;
+
+ rg = (struct gfs2_rgrp *)bh->b_data;
+ free_blocks = be32_to_cpu(rg->rg_free);
+ }
+ used_blocks += count_usedspace(sdp, first, bh);
+ first = 0;
+ block++;
+ length++;
+ brelse(bh);
+ /* Check if this distance points to an rgrp:
+ We have to look for blocks that resemble rgrps and bitmaps.
+ If they do, we need to count blocks used and free and see
+ if adding that number of free blocks accounts for the
+ next rgrp we find. Otherwise, you could have a length of
+ 6 with additional user blocks that just happen to look like
+ bitmap blocks. Count them all as bitmaps and you'll be
+ hopelessly lost. */
+ rgrp_dist = used_blocks + free_blocks + length;
+ next_block = prevrgd->ri.ri_addr + rgrp_dist;
+ /* Now we account for block rounding done by mkfs.gfs2 */
+ for (b = 0; b <= length + GFS2_NBBY; b++) {
+ if (next_block >= sdp->device.length)
+ break;
+ bh = bread(sdp, next_block + b);
+ gfs2_meta_header_in(&mh, bh);
+ brelse(bh);
+ if (mh.mh_magic == GFS2_MAGIC) {
+ if (mh.mh_type == GFS2_METATYPE_RG) {
+ found = 1;
+ break;
+ }
+ /* if the first thing we find is a bitmap,
+ there must be a damaged rgrp on the
+ previous block. */
+ if (mh.mh_type == GFS2_METATYPE_RB) {
+ found = 1;
+ rgrp_dist--;
+ break;
+ }
+ }
+ rgrp_dist++;
+ }
+ if (found) {
+ block = next_block;
+ log_info( _("rgrp found at 0x%llx, length=%d, "
+ "used=%llu, free=%d\n"),
+ prevrgd->ri.ri_addr, length,
+ (unsigned long long)used_blocks,
+ free_blocks);
+ break;
+ }
+ }
+ return rgrp_dist;
+}
+
+/*
+ * hunt_and_peck - find the distance to the next rgrp
+ *
+ * This function is only called if the rgrps are determined to be on uneven
+ * boundaries, and also corrupt. So we have to go out searching for one.
+ */
+static uint64_t hunt_and_peck(struct gfs2_sbd *sdp, uint64_t blk,
+ struct rgrp_list *prevrgd, uint64_t last_bump)
+{
+ uint64_t rgrp_dist = 0, block, twogigs, last_block, last_meg;
+ struct gfs2_buffer_head *bh;
+ struct gfs2_meta_header mh;
+ int b, mega_in_blocks;
+
+ /* Skip ahead the previous amount: we might get lucky.
+ If we're close to the end of the device, take the rest. */
+ if (gfs2_check_range(sdp, blk + last_bump))
+ return sdp->fssize - blk;
+
+ bh = bread(sdp, blk + last_bump);
+ gfs2_meta_header_in(&mh, bh);
+ brelse(bh);
+ if (mh.mh_magic == GFS2_MAGIC && mh.mh_type == GFS2_METATYPE_RG) {
+ log_info( _("rgrp found at 0x%llx, length=%lld\n"),
+ (unsigned long long)blk + last_bump,
+ (unsigned long long)last_bump);
+ return last_bump;
+ }
+
+ rgrp_dist = AWAY_FROM_BITMAPS; /* Get away from any bitmaps
+ associated with the previous rgrp */
+ block = prevrgd->ri.ri_addr + rgrp_dist;
+ /* Now we account for block rounding done by mkfs.gfs2. A rgrp can
+ be at most 2GB in size, so that's where we call it. We do somewhat
+ obscure math here to avoid integer overflows. */
+ mega_in_blocks = (1024 * 1024) / sdp->bsize;
+ twogigs = 2048 * mega_in_blocks;
+ if (block + twogigs <= sdp->fssize) {
+ last_block = twogigs;
+ last_meg = 0;
+ } else {
+ /* There won't be a rgrp in the last megabyte. */
+ last_block = sdp->fssize - block - mega_in_blocks;
+ last_meg = mega_in_blocks;
+ }
+ for (b = AWAY_FROM_BITMAPS; b < last_block; b++) {
+ bh = bread(sdp, block + b);
+ gfs2_meta_header_in(&mh, bh);
+ brelse(bh);
+ if (mh.mh_magic == GFS2_MAGIC) {
+ if (mh.mh_type == GFS2_METATYPE_RG)
+ break;
+ /* if the first thing we find is a bitmap, there must
+ be a damaged rgrp on the previous block. */
+ if (mh.mh_type == GFS2_METATYPE_RB) {
+ rgrp_dist--;
+ break;
+ }
+ }
+ rgrp_dist++;
+ }
+ return rgrp_dist + last_meg;
+}
+
+/*
+ * gfs2_rindex_rebuild - rebuild a corrupt Resource Group (RG) index manually
+ * where trust_lvl == distrust
+ *
+ * If this routine is called, it means we have RGs in odd/unexpected places,
+ * and there is a corrupt RG or RG index entry. It also means we can't trust
+ * the RG index to be sane, and the RGs don't agree with how mkfs would have
+ * built them by default. So we have no choice but to go through and count
+ * them by hand. We've tried twice to recover the RGs and RG index, and
+ * failed, so this is our last chance to remedy the situation.
+ *
+ * This routine tries to minimize performance impact by:
+ * 1. Skipping through the filesystem at known increments when possible.
+ * 2. Shuffle through every block when RGs are not found at the predicted
+ * locations.
+ *
+ * Note: A GFS2 filesystem differs from a GFS1 file system in that there will
+ * only be ONE chunk (i.e. no artificial subdevices on either size of the
+ * journals). The journals and even the rindex are kept as part of the file
+ * system, so we need to rebuild that information by hand. Also, with GFS1,
+ * the different chunks ("subdevices") could have different RG sizes, which
+ * made for quite a mess when trying to recover RGs. GFS2 always uses the
+ * same RG size determined by the original mkfs, so recovery is easier.
+ *
+ * If "gfs_grow" is specified the file system was most likely converted
+ * from gfs1 to gfs2 after a gfs_grow operation. In that case, the rgrps
+ * will not be on predictable boundaries.
+ */
+static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
+ int *num_rgs, int gfs_grow)
+{
+ struct gfs2_buffer_head *bh;
+ uint64_t shortest_dist_btwn_rgs;
+ uint64_t blk;
+ uint64_t fwd_block, block_bump;
+ uint64_t first_rg_dist, initial_first_rg_dist;
+ struct rgrp_list *calc_rgd, *prev_rgd;
+ int number_of_rgs, rgi;
+ int rg_was_fnd = FALSE, corrupt_rgs = 0, bitmap_was_fnd;
+ osi_list_t *tmp;
+
+ osi_list_init(ret_list);
+ initial_first_rg_dist = first_rg_dist = sdp->sb_addr + 1;
+ shortest_dist_btwn_rgs = find_shortest_rgdist(sdp,
+ &initial_first_rg_dist,
+ &first_rg_dist);
+ number_of_rgs = 0;
/* -------------------------------------------------------------- */
/* Now go through the RGs and verify their integrity, fixing as */
/* needed when corruption is encountered. */
/* -------------------------------------------------------------- */
prev_rgd = NULL;
block_bump = first_rg_dist;
- for (blk = sdp->sb_addr + 1; blk <= sdp->device.length;
- blk += block_bump) {
+ blk = sdp->sb_addr + 1;
+ while (blk <= sdp->device.length) {
log_debug( _("Block 0x%" PRIx64 "\n"), blk);
bh = bread(sdp, blk);
rg_was_fnd = (!gfs2_check_meta(bh, GFS2_METATYPE_RG));
@@ -212,7 +457,7 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
/* Allocate a new RG and index. */
calc_rgd = malloc(sizeof(struct rgrp_list));
if (!calc_rgd) {
- log_crit( _("Can't allocate memory for rg repair.\n"));
+ log_crit( _("Can't allocate memory for rgrp repair.\n"));
return -1;
}
memset(calc_rgd, 0, sizeof(struct rgrp_list));
@@ -225,11 +470,13 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
/* ------------------------------------------------- */
corrupt_rgs++;
if (corrupt_rgs < 5)
- log_debug( _("Missing or damaged RG at block %"
+ log_debug( _("Missing or damaged rgrp at block %"
PRIu64 " (0x%" PRIx64 ")\n"),
blk, blk);
else {
- log_crit( _("Error: too many bad RGs.\n"));
+ log_crit( _("Error: too many missing or "
+ "damaged rgrps using this method. "
+ "Time to try another method.\n"));
return -1;
}
}
@@ -261,6 +508,8 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
prev_rgd->ri.ri_length = bitblocks;
prev_rgd->ri.ri_data = rgblocks;
+ prev_rgd->ri.ri_data0 = prev_rgd->ri.ri_addr +
+ prev_rgd->ri.ri_length;
prev_rgd->ri.ri_data -= prev_rgd->ri.ri_data %
GFS2_NBBY;
prev_rgd->ri.ri_bitbytes = prev_rgd->ri.ri_data /
@@ -269,18 +518,42 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
prev_rgd->ri.ri_data);
}
number_of_rgs++;
- log_warn( _("%c RG %d at block 0x%" PRIX64 " %s"),
- (rg_was_fnd ? ' ' : '*'), number_of_rgs, blk,
- (rg_was_fnd ? "intact" : "*** DAMAGED ***"));
+ if (rg_was_fnd)
+ log_info( _(" rgrp %d at block 0x%llx intact"),
+ number_of_rgs, (unsigned long long)blk);
+ else
+ log_warn( _("* rgrp %d at block 0x%llx *** DAMAGED ***"),
+ number_of_rgs, (unsigned long long)blk);
prev_rgd = calc_rgd;
- block_of_last_rg = blk;
-
+ /*
+ * Figure out where our next rgrp should be.
+ */
if (blk == sdp->sb_addr + 1)
block_bump = first_rg_dist;
- else
+ else if (!gfs_grow) {
block_bump = shortest_dist_btwn_rgs;
- if (block_bump != 1)
- log_warn( _(" [length 0x%" PRIx64 "]\n"), block_bump);
+ /* if we have uniformly-spaced rgrps, there may be
+ some wasted space at the end of the device.
+ Since we don't want to create a short rgrp and
+ break our uniformity, just quit here. */
+ if (blk + (2 * block_bump) > sdp->device.length)
+ break;
+ } else if (rg_was_fnd)
+ block_bump = find_next_rgrp_dist(sdp, blk, prev_rgd);
+ else
+ block_bump = hunt_and_peck(sdp, blk, prev_rgd,
+ block_bump);
+ if (block_bump != 1) {
+ if (rg_was_fnd)
+ log_info( _(" [length 0x%" PRIx64 "]\n"),
+ block_bump);
+ else
+ log_warn( _(" [length 0x%" PRIx64 "]\n"),
+ block_bump);
+ } else {
+ log_warn("\n");
+ }
+ blk += block_bump;
} /* for each rg block */
/* ----------------------------------------------------------------- */
/* If we got to the end of the fs, we still need to fix the */
@@ -293,6 +566,8 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
rgblocks2bitblocks(sdp->bsize, &rgblocks, &bitblocks);
prev_rgd->ri.ri_length = bitblocks;
+ prev_rgd->ri.ri_data0 = prev_rgd->ri.ri_addr +
+ prev_rgd->ri.ri_length;
prev_rgd->ri.ri_data = rgblocks;
prev_rgd->ri.ri_data -= prev_rgd->ri.ri_data % GFS2_NBBY;
prev_rgd->ri.ri_bitbytes = prev_rgd->ri.ri_data / GFS2_NBBY;
@@ -303,8 +578,8 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
/* ---------------------------------------------- */
/* Now dump out the information (if verbose mode) */
/* ---------------------------------------------- */
- log_debug( _("RG index rebuilt as follows:\n"));
- for (tmp = ret_list, rgi = 0; tmp != ret_list;
+ log_debug( _("rindex rebuilt as follows:\n"));
+ for (tmp = ret_list->next, rgi = 0; tmp != ret_list;
tmp = tmp->next, rgi++) {
calc_rgd = osi_list_entry(tmp, struct rgrp_list, list);
log_debug("%d: 0x%llx / %x / 0x%llx"
@@ -334,8 +609,18 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
static int gfs2_rindex_calculate(struct gfs2_sbd *sdp, osi_list_t *ret_list,
int *num_rgs)
{
+ uint64_t num_rgrps = 0;
+
+ /* ----------------------------------------------------------------- */
+ /* Calculate how many RGs there are supposed to be based on the */
+ /* rindex filesize. Remember that our trust level is open-minded */
+ /* here. If the filesize of the rindex file is not a multiple of */
+ /* our rindex structures, then something's wrong and we can't trust */
+ /* the index. */
+ /* ----------------------------------------------------------------- */
+ *num_rgs = sdp->md.riinode->i_di.di_size / sizeof(struct gfs2_rindex);
+
osi_list_init(ret_list);
- sdp->rgsize = GFS2_DEFAULT_RGSIZE; /* compute_rgrp_layout adjusts */
if (device_geometry(sdp)) {
fprintf(stderr, _("Geometry error\n"));
exit(-1);
@@ -346,21 +631,23 @@ static int gfs2_rindex_calculate(struct gfs2_sbd *sdp, osi_list_t *ret_list,
exit(-1);
}
+ /* Try all possible rgrp sizes: 2048, 1024, 512, 256, 128, 64, 32 */
+ for (sdp->rgsize = GFS2_DEFAULT_RGSIZE; sdp->rgsize >= 32;
+ sdp->rgsize /= 2) {
+ num_rgrps = how_many_rgrps(sdp, &sdp->device, TRUE);
+ if (num_rgrps == *num_rgs) {
+ log_info(_("rgsize must be: %lld (0x%llx)\n"),
+ (unsigned long long)sdp->rgsize,
+ (unsigned long long)sdp->rgsize);
+ break;
+ }
+ }
/* Compute the default resource group layout as mkfs would have done */
- compute_rgrp_layout(sdp, FALSE);
+ compute_rgrp_layout(sdp, TRUE);
build_rgrps(sdp, FALSE); /* FALSE = calc but don't write to disk. */
- *num_rgs = 0;
log_debug( _("fs_total_size = 0x%" PRIX64 " blocks.\n"),
sdp->device.length);
- /* ----------------------------------------------------------------- */
- /* Calculate how many RGs there are supposed to be based on the */
- /* rindex filesize. Remember that our trust level is open-minded */
- /* here. If the filesize of the rindex file is not a multiple of */
- /* our rindex structures, then something's wrong and we can't trust */
- /* the index. */
- /* ----------------------------------------------------------------- */
- *num_rgs = sdp->md.riinode->i_di.di_size / sizeof(struct gfs2_rindex);
- log_warn( _("L2: number of rgs in the index = %d.\n"), *num_rgs);
+ log_warn( _("L3: number of rgs in the index = %d.\n"), *num_rgs);
/* Move the rg list to the return list */
ret_list->next = sdp->rglist.next;
ret_list->prev = sdp->rglist.prev;
@@ -377,14 +664,14 @@ static int rewrite_rg_block(struct gfs2_sbd *sdp, struct rgrp_list *rg,
uint64_t errblock)
{
int x = errblock - rg->ri.ri_addr;
+ const char *typedesc = x ? "GFS2_METATYPE_RB" : "GFS2_METATYPE_RG";
- log_err( _("Block #%lld (0x%llx) (%d of %d) is neither"
- " GFS2_METATYPE_RB nor GFS2_METATYPE_RG.\n"),
+ log_err( _("Block #%lld (0x%llx) (%d of %d) is not %s.\n"),
(unsigned long long)rg->ri.ri_addr + x,
(unsigned long long)rg->ri.ri_addr + x,
- (int)x+1, (int)rg->ri.ri_length);
+ (int)x+1, (int)rg->ri.ri_length, typedesc);
if (query( _("Fix the Resource Group? (y/n)"))) {
- log_err( _("Attempting to repair the RG.\n"));
+ log_err( _("Attempting to repair the rgrp.\n"));
rg->bh[x] = bread(sdp, rg->ri.ri_addr + x);
if (x) {
struct gfs2_meta_header mh;
@@ -434,6 +721,7 @@ static int expect_rindex_sanity(struct gfs2_sbd *sdp, osi_list_t *ret_list,
memcpy(&exp->ri, &rgd->ri, sizeof(exp->ri));
memcpy(&exp->rg, &rgd->rg, sizeof(exp->rg));
exp->bits = NULL;
+ exp->bh = NULL;
gfs2_compute_bitstructs(sdp, exp);
osi_list_add_prev(&exp->list, ret_list);
}
@@ -442,21 +730,59 @@ static int expect_rindex_sanity(struct gfs2_sbd *sdp, osi_list_t *ret_list,
}
/*
+ * sort_rgrp_list - sort the rgrp list
+ *
+ * A bit crude, perhaps, but we're talking about thousands, not millions of
+ * entries to sort, and the list will be almost sorted anyway, so there
+ * should be very few swaps.
+ */
+static void sort_rgrp_list(osi_list_t *head)
+{
+ struct rgrp_list *thisr, *nextr;
+ osi_list_t *tmp, *x, *next;
+ int swaps;
+
+ while(1) {
+ swaps = 0;
+ osi_list_foreach_safe(tmp, head, x) {
+ next = tmp->next;
+ if (next == head) /* at the end */
+ break;
+ thisr = osi_list_entry(tmp, struct rgrp_list, list);
+ nextr = osi_list_entry(next, struct rgrp_list, list);
+ if (thisr->ri.ri_addr > nextr->ri.ri_addr) {
+ osi_list_del(next);
+ osi_list_add_prev(next, tmp);
+ swaps++;
+ }
+ }
+ if (!swaps)
+ break;
+ }
+}
+
+/*
* rg_repair - try to repair a damaged rg index (rindex)
* trust_lvl - This is how much we trust the rindex file.
* blind_faith means we take the rindex at face value.
* open_minded means it might be okay, but we should verify it.
* distrust means it's not to be trusted, so we should go to
* greater lengths to build it from scratch.
+ * indignation means we have corruption, but the file system
+ * was converted from GFS via gfs2_convert, and its rgrps are
+ * not on nice boundaries thanks to previous gfs_grow ops. Lovely.
*/
int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
{
- int error, discrepancies;
+ int error, discrepancies, percent;
osi_list_t expected_rglist;
int calc_rg_count = 0, rgcount_from_index, rg;
osi_list_t *exp, *act; /* expected, actual */
struct gfs2_rindex buf;
+ /* Free previous incarnations in memory, if any. */
+ gfs2_rgrp_free(&sdp->rglist);
+
if (trust_lvl == blind_faith)
return 0;
else if (trust_lvl == ye_of_little_faith) { /* if rindex seems sane */
@@ -467,8 +793,10 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
}
error = expect_rindex_sanity(sdp, &expected_rglist,
&calc_rg_count);
- if (error)
+ if (error) {
+ gfs2_rgrp_free(&expected_rglist);
return error;
+ }
} else if (trust_lvl == open_minded) { /* If we can't trust RG index */
/* Calculate our own RG index for comparison */
error = gfs2_rindex_calculate(sdp, &expected_rglist,
@@ -480,9 +808,19 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
}
else if (trust_lvl == distrust) { /* If we can't trust RG index */
error = gfs2_rindex_rebuild(sdp, &expected_rglist,
- &calc_rg_count);
+ &calc_rg_count, 0);
if (error) {
- log_crit( _("Error rebuilding rg list.\n"));
+ log_crit( _("Error rebuilding rgrp list.\n"));
+ gfs2_rgrp_free(&expected_rglist);
+ return -1;
+ }
+ sdp->rgrps = calc_rg_count;
+ }
+ else if (trust_lvl == indignation) { /* If we can't trust anything */
+ error = gfs2_rindex_rebuild(sdp, &expected_rglist,
+ &calc_rg_count, 1);
+ if (error) {
+ log_crit( _("Error rebuilding rgrp list.\n"));
gfs2_rgrp_free(&expected_rglist);
return -1;
}
@@ -500,13 +838,24 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
log_warn( _("L%d: number of rgs expected = %lld.\n"), trust_lvl + 1,
(unsigned long long)sdp->rgrps);
if (calc_rg_count != sdp->rgrps) {
- log_warn( _("L%d: They don't match; either (1) the fs was extended, (2) an odd\n"), trust_lvl + 1);
- log_warn( _("L%d: rg size was used, or (3) we have a corrupt rg index.\n"), trust_lvl + 1);
+ log_warn( _("L%d: They don't match; either (1) the fs was "
+ "extended, (2) an odd\n"), trust_lvl + 1);
+ log_warn( _("L%d: rgrp size was used, or (3) we have a corrupt "
+ "rg index.\n"), trust_lvl + 1);
gfs2_rgrp_free(&expected_rglist);
gfs2_rgrp_free(&sdp->rglist);
return -1;
}
/* ------------------------------------------------------------- */
+ /* Sort the rindex list. Older versions of gfs_grow got the */
+ /* rindex out of sorted order. But rebuilding the rindex from */
+ /* scratch will rebuild it in sorted order. */
+ /* The gfs2_grow program should, in theory, drop new rgrps into */
+ /* the rindex in sorted order, so this should only matter for */
+ /* gfs1 converted file systems. */
+ /* ------------------------------------------------------------- */
+ sort_rgrp_list(&sdp->rglist);
+ /* ------------------------------------------------------------- */
/* Now compare the rindex to what we think it should be. */
/* See how far off our expected values are. If too much, abort. */
/* The theory is: if we calculated the index to have 32 RGs and */
@@ -515,28 +864,52 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
/* ------------------------------------------------------------- */
discrepancies = 0;
for (rg = 0, act = sdp->rglist.next, exp = expected_rglist.next;
- act != &sdp->rglist && exp != &expected_rglist;
- act = act->next, exp = exp->next, rg++) {
+ act != &sdp->rglist && exp != &expected_rglist && !fsck_abort;
+ rg++) {
struct rgrp_list *expected, *actual;
expected = osi_list_entry(exp, struct rgrp_list, list);
actual = osi_list_entry(act, struct rgrp_list, list);
- if (!ri_equal(actual->ri, expected->ri, ri_addr) ||
- !ri_equal(actual->ri, expected->ri, ri_length) ||
+ if (actual->ri.ri_addr < expected->ri.ri_addr) {
+ act = act->next;
+ discrepancies++;
+ log_info(_("%d addr: 0x%llx < 0x%llx * mismatch\n"),
+ rg + 1, actual->ri.ri_addr,
+ expected->ri.ri_addr);
+ continue;
+ } else if (expected->ri.ri_addr < actual->ri.ri_addr) {
+ exp = exp->next;
+ discrepancies++;
+ log_info(_("%d addr: 0x%llx > 0x%llx * mismatch\n"),
+ rg + 1, actual->ri.ri_addr,
+ expected->ri.ri_addr);
+ continue;
+ }
+ if (!ri_equal(actual->ri, expected->ri, ri_length) ||
!ri_equal(actual->ri, expected->ri, ri_data0) ||
!ri_equal(actual->ri, expected->ri, ri_data) ||
!ri_equal(actual->ri, expected->ri, ri_bitbytes)) {
discrepancies++;
+ log_info(_("%d addr: 0x%llx 0x%llx * has mismatch\n"),
+ rg + 1, actual->ri.ri_addr,
+ expected->ri.ri_addr);
}
+ act = act->next;
+ exp = exp->next;
}
- if (trust_lvl < distrust && discrepancies > (trust_lvl * 8)) {
- log_warn( _("Level %d didn't work. Too many descepencies.\n"),
- trust_lvl + 1);
- log_warn( _("%d out of %d RGs did not match what was expected.\n"),
- discrepancies, rg);
- gfs2_rgrp_free(&expected_rglist);
- gfs2_rgrp_free(&sdp->rglist);
- return -1;
+ if (rg) {
+ /* Check to see if more than 2% of the rgrps are wrong. */
+ percent = (discrepancies * 100) / rg;
+ if (percent > BAD_RG_PERCENT_TOLERANCE) {
+ log_warn( _("Level %d didn't work. Too many "
+ "discrepancies.\n"), trust_lvl + 1);
+ log_warn( _("%d out of %d rgrps (%d percent) did not "
+ "match what was expected.\n"),
+ discrepancies, rg, percent);
+ gfs2_rgrp_free(&expected_rglist);
+ gfs2_rgrp_free(&sdp->rglist);
+ return -1;
+ }
}
/* ------------------------------------------------------------- */
/* Now compare the rindex to what we think it should be. */
@@ -544,17 +917,38 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
/* so look for index problems first before looking at the rgs. */
/* ------------------------------------------------------------- */
for (rg = 0, act = sdp->rglist.next, exp = expected_rglist.next;
- act != &sdp->rglist && exp != &expected_rglist;
- act = act->next, exp = exp->next, rg++) {
+ exp != &expected_rglist && !fsck_abort; rg++) {
struct rgrp_list *expected, *actual;
expected = osi_list_entry(exp, struct rgrp_list, list);
- actual = osi_list_entry(act, struct rgrp_list, list);
- ri_compare(rg, actual->ri, expected->ri, ri_addr, "llx");
- ri_compare(rg, actual->ri, expected->ri, ri_length, PRIx32);
- ri_compare(rg, actual->ri, expected->ri, ri_data0, "llx");
- ri_compare(rg, actual->ri, expected->ri, ri_data, PRIx32);
- ri_compare(rg, actual->ri, expected->ri, ri_bitbytes, PRIx32);
+
+ /* If we ran out of actual rindex entries due to rindex
+ damage, fill in a new one with the expected values. */
+ if (act == &sdp->rglist) { /* end of actual rindex */
+ log_err( _("Entry missing from rindex: 0x%llx\n"),
+ (unsigned long long)expected->ri.ri_addr);
+ actual = (struct rgrp_list *)
+ malloc(sizeof(struct rgrp_list));
+ if (!actual) {
+ log_err(_("Out of memory!\n"));
+ break;
+ }
+ memset(actual, 0, sizeof(struct rgrp_list));
+ osi_list_add_prev(&actual->list, &sdp->rglist);
+ rindex_modified = 1;
+ } else {
+ actual = osi_list_entry(act, struct rgrp_list, list);
+ ri_compare(rg, actual->ri, expected->ri, ri_addr,
+ "llx");
+ ri_compare(rg, actual->ri, expected->ri, ri_length,
+ PRIx32);
+ ri_compare(rg, actual->ri, expected->ri, ri_data0,
+ "llx");
+ ri_compare(rg, actual->ri, expected->ri, ri_data,
+ PRIx32);
+ ri_compare(rg, actual->ri, expected->ri, ri_bitbytes,
+ PRIx32);
+ }
/* If we modified the index, write it back to disk. */
if (rindex_modified) {
if (query( _("Fix the index? (y/n)"))) {
@@ -572,22 +966,27 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
/* Therefore, gfs2_compute_bitstructs might */
/* have malloced the wrong length for bitmap */
/* buffers. So we have to redo it. */
- if (actual->bits)
+ if (actual->bits) {
free(actual->bits);
+ actual->bits = NULL;
+ }
}
else
- log_err( _("RG index not fixed.\n"));
+ log_err( _("rindex not fixed.\n"));
gfs2_compute_bitstructs(sdp, actual);
rindex_modified = FALSE;
}
+ exp = exp->next;
+ if (act != &sdp->rglist)
+ act = act->next;
}
/* ------------------------------------------------------------- */
/* Read the real RGs and check their integrity. */
/* Now we can somewhat trust the rindex and the RG addresses, */
/* so let's read them in, check them and optionally fix them. */
/* ------------------------------------------------------------- */
- for (rg = 0, act = sdp->rglist.next; act != &sdp->rglist;
- act = act->next, rg++) {
+ for (rg = 0, act = sdp->rglist.next; act != &sdp->rglist &&
+ !fsck_abort; act = act->next, rg++) {
struct rgrp_list *rgd;
uint64_t prev_err = 0, errblock;
int i;
diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
index a15c31f..7c07891 100644
--- a/gfs2/libgfs2/fs_geometry.c
+++ b/gfs2/libgfs2/fs_geometry.c
@@ -22,7 +22,7 @@
* Returns: the number of RGs
*/
-static uint64_t how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev, int rgsize_specified)
+uint64_t how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev, int rgsize_specified)
{
uint64_t nrgrp;
uint32_t rgblocks1, rgblocksn, bitblocks1, bitblocksn;
@@ -117,7 +117,8 @@ void compute_rgrp_layout(struct gfs2_sbd *sdp, int rgsize_specified)
nrgrp = rgrp + sdp->new_rgrps;
}
- log_info("\nNew resource groups:\n");
+ if (rgrp < nrgrp)
+ log_info("\nNew resource groups:\n");
for (; rgrp < nrgrp; rgrp++) {
rl = calloc(1, sizeof(struct rgrp_list));
if (rl == NULL) {
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 5545b52..9e97267 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -413,6 +413,8 @@ extern int gfs2_set_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, int state);
/* fs_geometry.c */
extern void rgblocks2bitblocks(unsigned int bsize, uint32_t *rgblocks,
uint32_t *bitblocks);
+extern uint64_t how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev,
+ int rgsize_specified);
extern void compute_rgrp_layout(struct gfs2_sbd *sdp, int rgsize_specified);
extern void build_rgrps(struct gfs2_sbd *sdp, int write);
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index d37ed1b..b35c241 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -132,7 +132,15 @@ struct rgrp_list *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, uint64_t blk)
uint64_t gfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_list *rgd)
{
int x, length = rgd->ri.ri_length;
+ uint64_t max_rgrp_bitbytes, max_rgrp_len;
+ /* Max size of an rgrp is 2GB. Figure out how many blocks that is: */
+ max_rgrp_bitbytes = ((2147483648 / sdp->bsize) / GFS2_NBBY);
+ max_rgrp_len = max_rgrp_bitbytes / sdp->bsize;
+ if (!length && length > max_rgrp_len)
+ return -1;
+ if (gfs2_check_range(sdp, rgd->ri.ri_addr))
+ return -1;
for (x = 0; x < length; x++){
rgd->bh[x] = bread(sdp, rgd->ri.ri_addr + x);
if(gfs2_check_meta(rgd->bh[x],
@@ -149,7 +157,8 @@ uint64_t gfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_list *rgd)
}
}
- gfs2_rgrp_in(&rgd->rg, rgd->bh[0]);
+ if (rgd->bh && rgd->bh[0])
+ gfs2_rgrp_in(&rgd->rg, rgd->bh[0]);
return 0;
}
@@ -158,8 +167,10 @@ void gfs2_rgrp_relse(struct rgrp_list *rgd)
int x, length = rgd->ri.ri_length;
for (x = 0; x < length; x++) {
- brelse(rgd->bh[x]);
- rgd->bh[x] = NULL;
+ if (rgd->bh && rgd->bh[x]) {
+ brelse(rgd->bh[x]);
+ rgd->bh[x] = NULL;
+ }
}
}
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 5d232a6..f2dd171 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -180,10 +180,8 @@ int rindex_read(struct gfs2_sbd *sdp, int fd, int *count1, int *sane)
prev_rgd->length = prev_length;
}
- if(gfs2_compute_bitstructs(sdp, rgd)) {
+ if(gfs2_compute_bitstructs(sdp, rgd))
*sane = 0;
- return -1;
- }
(*count1)++;
prev_rgd = rgd;
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index efe3bfb..3436019 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -180,7 +180,7 @@ static void initialize_new_portion(struct gfs2_sbd *sdp, int *old_rg_count)
osi_list_del(head->next);
}
/* Issue a discard ioctl for the new portion */
- rl = osi_list_entry(&sdp->rglist.next, struct rgrp_list, list);
+ rl = osi_list_entry(sdp->rglist.next, struct rgrp_list, list);
discard_blocks(sdp->device_fd, rl->start * sdp->bsize,
(sdp->device.length - rl->start) * sdp->bsize);
/* Build the remaining resource groups */
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: d8c8af9612e2e00b8d8739a3d72ca9669a593878
Parent: fdc45edc17d329f966acac1b0832a437ba8c6a3e
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed Feb 2 09:28:26 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Feb 2 09:28:26 2011 -0600
fsck.gfs2: can't repair rgrps resulting from gfs_grow->gfs2_convert
This patch expands the algorithm that repairs destroyed resource
groups. It adds more levels of checking and is able to determine
the locations of resource groups that are not evenly spaced.
rhbz#576640
---
gfs2/edit/savemeta.c | 10 +-
gfs2/fsck/fsck.h | 5 +-
gfs2/fsck/initialize.c | 32 ++-
gfs2/fsck/main.c | 3 +-
gfs2/fsck/metawalk.c | 4 +
gfs2/fsck/pass2.c | 12 +
gfs2/fsck/rgrepair.c | 656 +++++++++++++++++++++++++++++++++++---------
gfs2/libgfs2/fs_geometry.c | 5 +-
gfs2/libgfs2/libgfs2.h | 2 +
gfs2/libgfs2/rgrp.c | 17 +-
gfs2/libgfs2/super.c | 4 +-
gfs2/mkfs/main_grow.c | 2 +-
12 files changed, 603 insertions(+), 149 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index fa2b9bf..666a452 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -203,7 +203,7 @@ static int save_block(int fd, int out_fd, uint64_t blk)
if (blk > last_fs_block) {
fprintf(stderr, "\nWarning: bad block pointer '0x%llx' "
- "ignored in block (block %llu (%llx))",
+ "ignored in block (block %llu (0x%llx))",
(unsigned long long)blk,
(unsigned long long)block, (unsigned long long)block);
return 0;
@@ -324,7 +324,9 @@ static void save_indirect_blocks(int out_fd, osi_list_t *cur_list,
if (height != hgt) { /* If not at max height */
nbh = bread(&sbd, indir_block);
osi_list_add_prev(&nbh->b_altlist, cur_list);
- brelse(nbh);
+ /* The buffer_head needs to be queued ahead, so
+ don't release it!
+ brelse(nbh);*/
}
} /* for all data on the indirect block */
}
@@ -370,8 +372,8 @@ static void save_inode_data(int out_fd)
(S_ISDIR(inode->i_di.di_mode) ||
(gfs1 && inode->i_di.__pad1 == GFS_FILE_DIR)))
height++;
- else if (height && !block_is_systemfile() &&
- !S_ISDIR(inode->i_di.di_mode))
+ else if (height && !(inode->i_di.di_flags & GFS2_DIF_SYSTEM) &&
+ !block_is_systemfile() && !S_ISDIR(inode->i_di.di_mode))
height--;
osi_list_add(&metabh->b_altlist, &metalist[0]);
for (i = 1; i <= height; i++){
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index b0e1efc..bc14b88 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -84,9 +84,12 @@ enum rgindex_trust_level { /* how far can we trust our RG index? */
open_minded = 2, /* At least 1 RG is corrupt. Try to calculate what it
should be, in a perfect world where our RGs are all
on even boundaries. Blue sky. Chirping birds. */
- distrust = 3 /* The world isn't perfect, our RGs are not on nice neat
+ distrust = 3, /* The world isn't perfect, our RGs are not on nice neat
boundaries. The fs must have been messed with by
gfs2_grow or something. Count the RGs by hand. */
+ indignation = 4 /* Not only do we have corruption, but the rgrps
+ aren't on even boundaries, so this file system
+ must have been converted from gfs2_convert. */
};
extern struct gfs2_inode *fsck_load_inode(struct gfs2_sbd *sbp, uint64_t block);
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 8859032..9fe7776 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -145,7 +145,8 @@ static int set_block_ranges(struct gfs2_sbd *sdp)
{
rgd = osi_list_entry(tmp, struct rgrp_list, list);
ri = &rgd->ri;
- if (ri->ri_data0 + ri->ri_data - 1 > rmax)
+ if (ri->ri_data0 + ri->ri_data &&
+ ri->ri_data0 + ri->ri_data - 1 > rmax)
rmax = ri->ri_data0 + ri->ri_data - 1;
if (!rmin || ri->ri_data0 < rmin)
rmin = ri->ri_data0;
@@ -406,6 +407,20 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
int rgcount, sane = 1;
enum rgindex_trust_level trust_lvl;
uint64_t addl_mem_needed;
+ const char *level_desc[] = {
+ _("Checking if all rgrp and rindex values are good"),
+ _("Checking if rindex values are ascending and evenly spaced"),
+ _("Calculating where the rgrps should be if evenly spaced"),
+ _("Trying to rebuild rindex assuming evenly spaced rgrps"),
+ _("Trying to rebuild rindex assuming unevenly spaced rgrps"),
+ };
+ const char *fail_desc[] = {
+ _("Some damage was found; we need to take remedial measures"),
+ _("rindex is unevenly spaced: converted from gfs1 or corrupt"),
+ _("rindex calculations don't match: uneven rgrp boundaries"),
+ _("Too many rgrp misses: rgrps must be unevenly spaced"),
+ _("Too much damage found: we cannot rebuild this rindex"),
+ };
/*******************************************************************
****************** Initialize important inodes ******************
@@ -446,18 +461,23 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
******** Validate and read in resource group information ********
*******************************************************************/
log_warn( _("Validating Resource Group index.\n"));
- for (trust_lvl = blind_faith; trust_lvl <= distrust; trust_lvl++) {
- log_warn( _("Level %d RG check.\n"), trust_lvl + 1);
+ for (trust_lvl = blind_faith; trust_lvl <= indignation; trust_lvl++) {
+ log_warn( _("Level %d rgrp check: %s.\n"), trust_lvl + 1,
+ level_desc[trust_lvl]);
if ((rg_repair(sdp, trust_lvl, &rgcount, &sane) == 0) &&
(ri_update(sdp, 0, &rgcount, &sane) == 0)) {
log_warn( _("(level %d passed)\n"), trust_lvl + 1);
break;
}
else
- log_err( _("(level %d failed)\n"), trust_lvl + 1);
+ log_err( _("(level %d failed: %s)\n"), trust_lvl + 1,
+ fail_desc[trust_lvl]);
+ if (fsck_abort)
+ break;
}
- if (trust_lvl > distrust) {
- log_err( _("RG recovery impossible; I can't fix this file system.\n"));
+ if (trust_lvl > indignation) {
+ log_err( _("Resource Group recovery impossible; I can't fix "
+ "this file system.\n"));
return -1;
}
log_info( _("%u resource groups found.\n"), rgcount);
diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c
index 157ed02..bb540e7 100644
--- a/gfs2/fsck/main.c
+++ b/gfs2/fsck/main.c
@@ -336,7 +336,8 @@ int main(int argc, char **argv)
error = FSCK_CANCELED;
}
- check_statfs(sbp);
+ if (!fsck_abort)
+ check_statfs(sbp);
/* Free up our system inodes */
inode_put(&sbp->md.inum);
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 8415b15..3e7e653 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -729,6 +729,10 @@ static int check_leaf_blks(struct gfs2_inode *ip, struct metawalk_fxns *pass)
if (pass->check_dentry && S_ISDIR(ip->i_di.di_mode)) {
error = check_entries(ip, lbh, DIR_EXHASH,
&count, pass);
+
+ if (skip_this_pass || fsck_abort)
+ return 0;
+
if(error < 0) {
stack;
brelse(lbh);
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 42aa588..5379ec7 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -557,6 +557,8 @@ static int check_system_dir(struct gfs2_inode *sysinode, const char *dirname,
}
}
error = check_dir(sysinode->i_sbd, iblock, &pass2_fxns);
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
if(error < 0) {
stack;
return -1;
@@ -667,18 +669,26 @@ int pass2(struct gfs2_sbd *sbp)
stack;
return FSCK_ERROR;
}
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
if (check_system_dir(sbp->md.pinode, "per_node", build_per_node)) {
stack;
return FSCK_ERROR;
}
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
if (check_system_dir(sbp->master_dir, "master", build_master)) {
stack;
return FSCK_ERROR;
}
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
if (check_system_dir(sbp->md.rooti, "root", build_root)) {
stack;
return FSCK_ERROR;
}
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
log_info( _("Checking directory inodes.\n"));
/* Grab each directory inode, and run checks on it */
for(dirblk = 0; dirblk < last_fs_block; dirblk++) {
@@ -712,6 +722,8 @@ int pass2(struct gfs2_sbd *sbp)
}
}
error = check_dir(sbp, dirblk, &pass2_fxns);
+ if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
+ return FSCK_OK;
if(error < 0) {
stack;
return FSCK_ERROR;
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index ee062dc..bb0309c 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -17,6 +17,9 @@
int rindex_modified = FALSE;
struct special_blocks false_rgrps;
+#define BAD_RG_PERCENT_TOLERANCE 11
+#define AWAY_FROM_BITMAPS 0x1000
+
#define ri_equal(ondisk, expected, field) (ondisk.field == expected.field)
#define ri_compare(rg, ondisk, expected, field, fmt, type) \
@@ -49,7 +52,7 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
osi_list_init(&false_rgrps.list);
for (j = 0; j < sdp->md.journals; j++) {
- log_debug( _("Checking for RGs in journal%d.\n"), j);
+ log_debug( _("Checking for rgrps in journal%d.\n"), j);
ip = sdp->md.journal[j];
jblocks = ip->i_di.di_size / sdp->sd_sb.sb_bsize;
for (b = 0; b < jblocks; b++) {
@@ -58,7 +61,7 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
break;
bh = bread(sdp, dblock);
if (!gfs2_check_meta(bh, GFS2_METATYPE_RG)) {
- log_debug( _("False RG found at block 0x%llx\n"),
+ log_debug( _("False rgrp found at block 0x%llx\n"),
(unsigned long long)dblock);
gfs2_special_set(&false_rgrps, dblock);
}
@@ -75,66 +78,38 @@ static int is_false_rg(uint64_t block)
}
/*
- * gfs2_rindex_rebuild - rebuild a corrupt Resource Group (RG) index manually
- * where trust_lvl == distrust
- *
- * If this routine is called, it means we have RGs in odd/unexpected places,
- * and there is a corrupt RG or RG index entry. It also means we can't trust
- * the RG index to be sane, and the RGs don't agree with how mkfs would have
- * built them by default. So we have no choice but to go through and count
- * them by hand. We've tried twice to recover the RGs and RG index, and
- * failed, so this is our last chance to remedy the situation.
- *
- * This routine tries to minimize performance impact by:
- * 1. Skipping through the filesystem at known increments when possible.
- * 2. Shuffle through every block when RGs are not found at the predicted
- * locations.
- *
- * Note: A GFS2 filesystem differs from a GFS1 file system in that there will
- * only be ONE chunk (i.e. no artificial subdevices on either size of the
- * journals). The journals and even the rindex are kept as part of the file
- * system, so we need to rebuild that information by hand. Also, with GFS1,
- * the different chunks ("subdevices") could have different RG sizes, which
- * made for quite a mess when trying to recover RGs. GFS2 always uses the
- * same RG size determined by the original mkfs, so recovery is easier.
+ * find_shortest_rgdist - hunt and peck for the shortest distance between RGs.
*
+ * Sample several of them because an RG that's been blasted may
+ * look like twice the distance. If we can find 6 of them, that
+ * should be enough to figure out the correct layout.
+ * This also figures out first_rg_dist since that's always different.
*/
-static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
- int *num_rgs)
+static uint64_t find_shortest_rgdist(struct gfs2_sbd *sdp,
+ uint64_t *initial_first_rg_dist,
+ uint64_t *first_rg_dist)
{
+ uint64_t blk, block_of_last_rg, shortest_dist_btwn_rgs;
struct gfs2_buffer_head *bh;
- uint64_t shortest_dist_btwn_rgs;
- uint64_t blk, block_of_last_rg;
- uint64_t fwd_block, block_bump;
- uint64_t first_rg_dist, initial_first_rg_dist;
- struct rgrp_list *calc_rgd, *prev_rgd;
- int number_of_rgs, rgi;
+ int number_of_rgs = 0;
struct gfs2_rindex buf, tmpndx;
- int rg_was_fnd = FALSE, corrupt_rgs = 0, bitmap_was_fnd;
- osi_list_t *tmp;
/* Figure out if there are any RG-looking blocks in the journal we
need to ignore. */
find_journaled_rgs(sdp);
- osi_list_init(ret_list);
- number_of_rgs = 0;
- initial_first_rg_dist = first_rg_dist = sdp->sb_addr + 1;
+
+ *initial_first_rg_dist = *first_rg_dist = sdp->sb_addr + 1;
block_of_last_rg = sdp->sb_addr + 1;
- /* ------------------------------------------------------------- */
- /* First, hunt and peck for the shortest distance between RGs. */
- /* Sample several of them because an RG that's been blasted may */
- /* look like twice the distance. If we can find 6 of them, that */
- /* should be enough to figure out the correct layout. */
- /* ------------------------------------------------------------- */
shortest_dist_btwn_rgs = sdp->device.length;
+
for (blk = sdp->sb_addr + 1;
- blk < sdp->device.length && number_of_rgs < 6;
- blk++) {
+ blk < sdp->device.length && number_of_rgs < 6; blk++) {
bh = bread(sdp, blk);
if (((blk == sdp->sb_addr + 1) ||
(!gfs2_check_meta(bh, GFS2_METATYPE_RG))) &&
!is_false_rg(blk)) {
- log_debug( _("RG found at block 0x%llx\n"), (unsigned long long)blk);
+ log_debug( _("rgrp found at block 0x%llx\n"),
+ (unsigned long long)blk);
if (blk > sdp->sb_addr + 1) {
uint64_t rgdist;
@@ -151,8 +126,8 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
/* from the rest because of the superblock */
/* and 64K dead space. */
/* ----------------------------------------- */
- if (first_rg_dist == initial_first_rg_dist)
- first_rg_dist = rgdist;
+ if (*first_rg_dist == *initial_first_rg_dist)
+ *first_rg_dist = rgdist;
if (rgdist < shortest_dist_btwn_rgs) {
shortest_dist_btwn_rgs = rgdist;
log_debug( _("(shortest so far)\n"));
@@ -166,18 +141,15 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
}
brelse(bh);
}
- number_of_rgs = 0;
- gfs2_special_free(&false_rgrps);
-
/* -------------------------------------------------------------- */
/* Sanity-check our first_rg_dist. If RG #2 got nuked, the */
/* first_rg_dist would measure from #1 to #3, which would be bad. */
/* We need to take remedial measures to fix it (from the index). */
/* -------------------------------------------------------------- */
- log_debug( _("First RG distance: 0x%llx\n"), (unsigned long long)first_rg_dist);
- log_debug( _("Distance between RGs: 0x%llx\n"),
+ log_debug( _("First rgrp distance: 0x%llx\n"), (unsigned long long)*first_rg_dist);
+ log_debug( _("Distance between rgrps: 0x%llx\n"),
(unsigned long long)shortest_dist_btwn_rgs);
- if (first_rg_dist >= shortest_dist_btwn_rgs +
+ if (*first_rg_dist >= shortest_dist_btwn_rgs +
(shortest_dist_btwn_rgs / 4)) {
/* read in the second RG index entry for this subd. */
gfs2_readi(sdp->md.riinode, (char *)&buf,
@@ -185,28 +157,302 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
sizeof(struct gfs2_rindex));
gfs2_rindex_in(&tmpndx, (char *)&buf);
if (tmpndx.ri_addr > sdp->sb_addr + 1) { /* sanity check */
- log_warn( _("RG 2 is damaged: getting dist from index: "));
- first_rg_dist = tmpndx.ri_addr - (sdp->sb_addr + 1);
- log_warn("0x%llx\n", (unsigned long long)first_rg_dist);
+ log_warn( _("rgrp 2 is damaged: getting dist from index: "));
+ *first_rg_dist = tmpndx.ri_addr - (sdp->sb_addr + 1);
+ log_warn("0x%llx\n", (unsigned long long)*first_rg_dist);
}
else {
- log_warn( _("RG index 2 is damaged: extrapolating dist: "));
- first_rg_dist = sdp->device.length -
+ log_warn( _("rgrp index 2 is damaged: extrapolating dist: "));
+ *first_rg_dist = sdp->device.length -
(sdp->rgrps - 1) *
(sdp->device.length / sdp->rgrps);
- log_warn("0x%llx\n", (unsigned long long)first_rg_dist);
+ log_warn("0x%llx\n", (unsigned long long)*first_rg_dist);
}
- log_debug( _("Adjusted first RG distance: 0x%llx\n"),
- (unsigned long long)first_rg_dist);
+ log_debug( _("Adjusted first rgrp distance: 0x%llx\n"),
+ (unsigned long long)*first_rg_dist);
} /* if first RG distance is within tolerance */
+
+ gfs2_special_free(&false_rgrps);
+ return shortest_dist_btwn_rgs;
+}
+
+/*
+ * count_usedspace - count the used bits in a rgrp bitmap buffer
+ */
+static uint64_t count_usedspace(struct gfs2_sbd *sdp, int first,
+ struct gfs2_buffer_head *bh)
+{
+ int off, x, y, bytes_to_check;
+ uint32_t rg_used = 0;
+ unsigned int state;
+
+ /* Count up the free blocks in the bitmap */
+ off = (first) ? sizeof(struct gfs2_rgrp) :
+ sizeof(struct gfs2_meta_header);
+ bytes_to_check = sdp->bsize - off;
+ for (x = 0; x < bytes_to_check; x++) {
+ unsigned char *byte;
+
+ byte = (unsigned char *)&bh->b_data[off + x];
+ if (*byte == 0x55) {
+ rg_used += GFS2_NBBY;
+ continue;
+ }
+ if (*byte == 0x00)
+ continue;
+ for (y = 0; y < GFS2_NBBY; y++) {
+ state = (*byte >> (GFS2_BIT_SIZE * y)) & GFS2_BIT_MASK;
+ if (state == GFS2_BLKST_FREE ||
+ state == GFS2_BLKST_UNLINKED)
+ continue;
+ rg_used++;
+ }
+ }
+ return rg_used;
+}
+
+/*
+ * find_next_rgrp_dist - find the distance to the next rgrp
+ *
+ * This function is only called if the rgrps are determined to be on uneven
+ * boundaries. In a normal gfs2 file system, after mkfs.gfs2, all the
+ * rgrps but the first and second one will be the same distance from the
+ * previous rgrp. (The first rgrp will predictably be after the superblock
+ * and the second one will be adjusted based on the number 64KB skipped
+ * at the start of the file system.) The only way we can deviate from that
+ * pattern is if the user did gfs_grow on a gfs1 file system, then converted
+ * it to gfs2 using gfs2_convert.
+ *
+ * This function finds the distance to the next rgrp for these cases.
+ */
+static uint64_t find_next_rgrp_dist(struct gfs2_sbd *sdp, uint64_t blk,
+ struct rgrp_list *prevrgd)
+{
+ uint64_t rgrp_dist = 0, used_blocks, block, next_block, twogigs;
+ osi_list_t *tmp;
+ struct rgrp_list *rgd = NULL, *next_rgd;
+ struct gfs2_buffer_head *bh;
+ struct gfs2_meta_header mh;
+ int first, length, b, found, mega_in_blocks;
+ uint32_t free_blocks;
+
+ for (tmp = sdp->rglist.next; tmp != &sdp->rglist; tmp = tmp->next) {
+ rgd = osi_list_entry(tmp, struct rgrp_list, list);
+ if (rgd->ri.ri_addr == blk)
+ break;
+ }
+ if (rgd && tmp && tmp != &sdp->rglist && tmp->next &&
+ rgd->ri.ri_addr == blk) {
+ tmp = tmp->next;
+ next_rgd = osi_list_entry(tmp, struct rgrp_list, list);
+ rgrp_dist = next_rgd->ri.ri_addr - rgd->ri.ri_addr;
+ return rgrp_dist;
+ }
+ mega_in_blocks = (1024 * 1024) / sdp->bsize;
+ twogigs = 2048 * mega_in_blocks;
+ /* Unfortunately, if we fall through to here we can't trust the
+ rindex. So we have to analyze the current rgrp to figure out
+ the bare minimum block number where it ends. If we don't have
+ rindex, all we know about this rgrp is what's on disk: its
+ rg_free. If we analyze the rgrp's bitmap and the bitmaps that
+ follow, we can figure out how many bits are used. If we add
+ rg_free, we get the total number of blocks this rgrp
+ represents. After that should be the next rgrp, but it may
+ skip a few blocks (hopefully no more than 4). */
+ used_blocks = 0;
+ length = 0;
+ block = prevrgd->ri.ri_addr;
+ first = 1;
+ found = 0;
+ while (1) {
+ if (block >= sdp->device.length)
+ break;
+ if (block >= prevrgd->ri.ri_addr + twogigs)
+ break;
+ bh = bread(sdp, block);
+ gfs2_meta_header_in(&mh, bh);
+ if ((mh.mh_magic != GFS2_MAGIC) ||
+ (first && mh.mh_type != GFS2_METATYPE_RG) ||
+ (!first && mh.mh_type != GFS2_METATYPE_RB)) {
+ brelse(bh);
+ break;
+ }
+ if (first) {
+ struct gfs2_rgrp *rg;
+
+ rg = (struct gfs2_rgrp *)bh->b_data;
+ free_blocks = be32_to_cpu(rg->rg_free);
+ }
+ used_blocks += count_usedspace(sdp, first, bh);
+ first = 0;
+ block++;
+ length++;
+ brelse(bh);
+ /* Check if this distance points to an rgrp:
+ We have to look for blocks that resemble rgrps and bitmaps.
+ If they do, we need to count blocks used and free and see
+ if adding that number of free blocks accounts for the
+ next rgrp we find. Otherwise, you could have a length of
+ 6 with additional user blocks that just happen to look like
+ bitmap blocks. Count them all as bitmaps and you'll be
+ hopelessly lost. */
+ rgrp_dist = used_blocks + free_blocks + length;
+ next_block = prevrgd->ri.ri_addr + rgrp_dist;
+ /* Now we account for block rounding done by mkfs.gfs2 */
+ for (b = 0; b <= length + GFS2_NBBY; b++) {
+ if (next_block >= sdp->device.length)
+ break;
+ bh = bread(sdp, next_block + b);
+ gfs2_meta_header_in(&mh, bh);
+ brelse(bh);
+ if (mh.mh_magic == GFS2_MAGIC) {
+ if (mh.mh_type == GFS2_METATYPE_RG) {
+ found = 1;
+ break;
+ }
+ /* if the first thing we find is a bitmap,
+ there must be a damaged rgrp on the
+ previous block. */
+ if (mh.mh_type == GFS2_METATYPE_RB) {
+ found = 1;
+ rgrp_dist--;
+ break;
+ }
+ }
+ rgrp_dist++;
+ }
+ if (found) {
+ block = next_block;
+ log_info( _("rgrp found at 0x%llx, length=%d, "
+ "used=%llu, free=%d\n"),
+ prevrgd->ri.ri_addr, length,
+ (unsigned long long)used_blocks,
+ free_blocks);
+ break;
+ }
+ }
+ return rgrp_dist;
+}
+
+/*
+ * hunt_and_peck - find the distance to the next rgrp
+ *
+ * This function is only called if the rgrps are determined to be on uneven
+ * boundaries, and also corrupt. So we have to go out searching for one.
+ */
+static uint64_t hunt_and_peck(struct gfs2_sbd *sdp, uint64_t blk,
+ struct rgrp_list *prevrgd, uint64_t last_bump)
+{
+ uint64_t rgrp_dist = 0, block, twogigs, last_block, last_meg;
+ struct gfs2_buffer_head *bh;
+ struct gfs2_meta_header mh;
+ int b, mega_in_blocks;
+
+ /* Skip ahead the previous amount: we might get lucky.
+ If we're close to the end of the device, take the rest. */
+ if (gfs2_check_range(sdp, blk + last_bump))
+ return sdp->fssize - blk;
+
+ bh = bread(sdp, blk + last_bump);
+ gfs2_meta_header_in(&mh, bh);
+ brelse(bh);
+ if (mh.mh_magic == GFS2_MAGIC && mh.mh_type == GFS2_METATYPE_RG) {
+ log_info( _("rgrp found at 0x%llx, length=%lld\n"),
+ (unsigned long long)blk + last_bump,
+ (unsigned long long)last_bump);
+ return last_bump;
+ }
+
+ rgrp_dist = AWAY_FROM_BITMAPS; /* Get away from any bitmaps
+ associated with the previous rgrp */
+ block = prevrgd->ri.ri_addr + rgrp_dist;
+ /* Now we account for block rounding done by mkfs.gfs2. A rgrp can
+ be at most 2GB in size, so that's where we call it. We do somewhat
+ obscure math here to avoid integer overflows. */
+ mega_in_blocks = (1024 * 1024) / sdp->bsize;
+ twogigs = 2048 * mega_in_blocks;
+ if (block + twogigs <= sdp->fssize) {
+ last_block = twogigs;
+ last_meg = 0;
+ } else {
+ /* There won't be a rgrp in the last megabyte. */
+ last_block = sdp->fssize - block - mega_in_blocks;
+ last_meg = mega_in_blocks;
+ }
+ for (b = AWAY_FROM_BITMAPS; b < last_block; b++) {
+ bh = bread(sdp, block + b);
+ gfs2_meta_header_in(&mh, bh);
+ brelse(bh);
+ if (mh.mh_magic == GFS2_MAGIC) {
+ if (mh.mh_type == GFS2_METATYPE_RG)
+ break;
+ /* if the first thing we find is a bitmap, there must
+ be a damaged rgrp on the previous block. */
+ if (mh.mh_type == GFS2_METATYPE_RB) {
+ rgrp_dist--;
+ break;
+ }
+ }
+ rgrp_dist++;
+ }
+ return rgrp_dist + last_meg;
+}
+
+/*
+ * gfs2_rindex_rebuild - rebuild a corrupt Resource Group (RG) index manually
+ * where trust_lvl == distrust
+ *
+ * If this routine is called, it means we have RGs in odd/unexpected places,
+ * and there is a corrupt RG or RG index entry. It also means we can't trust
+ * the RG index to be sane, and the RGs don't agree with how mkfs would have
+ * built them by default. So we have no choice but to go through and count
+ * them by hand. We've tried twice to recover the RGs and RG index, and
+ * failed, so this is our last chance to remedy the situation.
+ *
+ * This routine tries to minimize performance impact by:
+ * 1. Skipping through the filesystem at known increments when possible.
+ * 2. Shuffle through every block when RGs are not found at the predicted
+ * locations.
+ *
+ * Note: A GFS2 filesystem differs from a GFS1 file system in that there will
+ * only be ONE chunk (i.e. no artificial subdevices on either size of the
+ * journals). The journals and even the rindex are kept as part of the file
+ * system, so we need to rebuild that information by hand. Also, with GFS1,
+ * the different chunks ("subdevices") could have different RG sizes, which
+ * made for quite a mess when trying to recover RGs. GFS2 always uses the
+ * same RG size determined by the original mkfs, so recovery is easier.
+ *
+ * If "gfs_grow" is specified the file system was most likely converted
+ * from gfs1 to gfs2 after a gfs_grow operation. In that case, the rgrps
+ * will not be on predictable boundaries.
+ */
+static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
+ int *num_rgs, int gfs_grow)
+{
+ struct gfs2_buffer_head *bh;
+ uint64_t shortest_dist_btwn_rgs;
+ uint64_t blk;
+ uint64_t fwd_block, block_bump;
+ uint64_t first_rg_dist, initial_first_rg_dist;
+ struct rgrp_list *calc_rgd, *prev_rgd;
+ int number_of_rgs, rgi;
+ int rg_was_fnd = FALSE, corrupt_rgs = 0, bitmap_was_fnd;
+ osi_list_t *tmp;
+
+ osi_list_init(ret_list);
+ initial_first_rg_dist = first_rg_dist = sdp->sb_addr + 1;
+ shortest_dist_btwn_rgs = find_shortest_rgdist(sdp,
+ &initial_first_rg_dist,
+ &first_rg_dist);
+ number_of_rgs = 0;
/* -------------------------------------------------------------- */
/* Now go through the RGs and verify their integrity, fixing as */
/* needed when corruption is encountered. */
/* -------------------------------------------------------------- */
prev_rgd = NULL;
block_bump = first_rg_dist;
- for (blk = sdp->sb_addr + 1; blk <= sdp->device.length;
- blk += block_bump) {
+ blk = sdp->sb_addr + 1;
+ while (blk <= sdp->device.length) {
log_debug( _("Block 0x%llx\n"), (unsigned long long)blk);
bh = bread(sdp, blk);
rg_was_fnd = (!gfs2_check_meta(bh, GFS2_METATYPE_RG));
@@ -214,7 +460,7 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
/* Allocate a new RG and index. */
calc_rgd = malloc(sizeof(struct rgrp_list));
if (!calc_rgd) {
- log_crit( _("Can't allocate memory for rg repair.\n"));
+ log_crit( _("Can't allocate memory for rgrp repair.\n"));
return -1;
}
memset(calc_rgd, 0, sizeof(struct rgrp_list));
@@ -227,11 +473,14 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
/* ------------------------------------------------- */
corrupt_rgs++;
if (corrupt_rgs < 5)
- log_debug( _("Missing or damaged RG at block %llu"
- " (0x%llx)\n"),
- (unsigned long long)blk, (unsigned long long)blk);
+ log_debug( _("Missing or damaged rgrp at block "
+ "%llu (0x%llx)\n"),
+ (unsigned long long)blk,
+ (unsigned long long)blk);
else {
- log_crit( _("Error: too many bad RGs.\n"));
+ log_crit( _("Error: too many missing or "
+ "damaged rgrps using this method. "
+ "Time to try another method.\n"));
return -1;
}
}
@@ -263,6 +512,8 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
prev_rgd->ri.ri_length = bitblocks;
prev_rgd->ri.ri_data = rgblocks;
+ prev_rgd->ri.ri_data0 = prev_rgd->ri.ri_addr +
+ prev_rgd->ri.ri_length;
prev_rgd->ri.ri_data -= prev_rgd->ri.ri_data %
GFS2_NBBY;
prev_rgd->ri.ri_bitbytes = prev_rgd->ri.ri_data /
@@ -271,19 +522,42 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
(unsigned long)prev_rgd->ri.ri_data);
}
number_of_rgs++;
- log_warn( _("%c RG %d at block 0x%llX %s"),
- (rg_was_fnd ? ' ' : '*'), number_of_rgs,
- (unsigned long long)blk,
- (rg_was_fnd ? "intact" : "*** DAMAGED ***"));
+ if (rg_was_fnd)
+ log_info( _(" rgrp %d at block 0x%llx intact"),
+ number_of_rgs, (unsigned long long)blk);
+ else
+ log_warn( _("* rgrp %d at block 0x%llx *** DAMAGED ***"),
+ number_of_rgs, (unsigned long long)blk);
prev_rgd = calc_rgd;
- block_of_last_rg = blk;
-
+ /*
+ * Figure out where our next rgrp should be.
+ */
if (blk == sdp->sb_addr + 1)
block_bump = first_rg_dist;
- else
+ else if (!gfs_grow) {
block_bump = shortest_dist_btwn_rgs;
- if (block_bump != 1)
- log_warn( _(" [length 0x%llx]\n"), (unsigned long long)block_bump);
+ /* if we have uniformly-spaced rgrps, there may be
+ some wasted space at the end of the device.
+ Since we don't want to create a short rgrp and
+ break our uniformity, just quit here. */
+ if (blk + (2 * block_bump) > sdp->device.length)
+ break;
+ } else if (rg_was_fnd)
+ block_bump = find_next_rgrp_dist(sdp, blk, prev_rgd);
+ else
+ block_bump = hunt_and_peck(sdp, blk, prev_rgd,
+ block_bump);
+ if (block_bump != 1) {
+ if (rg_was_fnd)
+ log_info( _(" [length 0x%llx]\n"),
+ (unsigned long long)block_bump);
+ else
+ log_warn( _(" [length 0x%llx]\n"),
+ (unsigned long long)block_bump);
+ } else {
+ log_warn("\n");
+ }
+ blk += block_bump;
} /* for each rg block */
/* ----------------------------------------------------------------- */
/* If we got to the end of the fs, we still need to fix the */
@@ -296,6 +570,8 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
rgblocks2bitblocks(sdp->bsize, &rgblocks, &bitblocks);
prev_rgd->ri.ri_length = bitblocks;
+ prev_rgd->ri.ri_data0 = prev_rgd->ri.ri_addr +
+ prev_rgd->ri.ri_length;
prev_rgd->ri.ri_data = rgblocks;
prev_rgd->ri.ri_data -= prev_rgd->ri.ri_data % GFS2_NBBY;
prev_rgd->ri.ri_bitbytes = prev_rgd->ri.ri_data / GFS2_NBBY;
@@ -306,8 +582,8 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
/* ---------------------------------------------- */
/* Now dump out the information (if verbose mode) */
/* ---------------------------------------------- */
- log_debug( _("RG index rebuilt as follows:\n"));
- for (tmp = ret_list, rgi = 0; tmp != ret_list;
+ log_debug( _("rindex rebuilt as follows:\n"));
+ for (tmp = ret_list->next, rgi = 0; tmp != ret_list;
tmp = tmp->next, rgi++) {
calc_rgd = osi_list_entry(tmp, struct rgrp_list, list);
log_debug("%d: 0x%llx / %x / 0x%llx"
@@ -337,33 +613,45 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
static int gfs2_rindex_calculate(struct gfs2_sbd *sdp, osi_list_t *ret_list,
int *num_rgs)
{
+ uint64_t num_rgrps = 0;
+
+ /* ----------------------------------------------------------------- */
+ /* Calculate how many RGs there are supposed to be based on the */
+ /* rindex filesize. Remember that our trust level is open-minded */
+ /* here. If the filesize of the rindex file is not a multiple of */
+ /* our rindex structures, then something's wrong and we can't trust */
+ /* the index. */
+ /* ----------------------------------------------------------------- */
+ *num_rgs = sdp->md.riinode->i_di.di_size / sizeof(struct gfs2_rindex);
+
osi_list_init(ret_list);
- sdp->rgsize = GFS2_DEFAULT_RGSIZE; /* compute_rgrp_layout adjusts */
if (device_geometry(sdp)) {
fprintf(stderr, _("Geometry error\n"));
exit(-1);
}
if (fix_device_geometry(sdp)) {
fprintf(stderr, _("Device is too small (%llu bytes)\n"),
- (unsigned long long)sdp->device.length << GFS2_BASIC_BLOCK_SHIFT);
+ (unsigned long long)sdp->device.length << GFS2_BASIC_BLOCK_SHIFT);
exit(-1);
}
+ /* Try all possible rgrp sizes: 2048, 1024, 512, 256, 128, 64, 32 */
+ for (sdp->rgsize = GFS2_DEFAULT_RGSIZE; sdp->rgsize >= 32;
+ sdp->rgsize /= 2) {
+ num_rgrps = how_many_rgrps(sdp, &sdp->device, TRUE);
+ if (num_rgrps == *num_rgs) {
+ log_info(_("rgsize must be: %lld (0x%llx)\n"),
+ (unsigned long long)sdp->rgsize,
+ (unsigned long long)sdp->rgsize);
+ break;
+ }
+ }
/* Compute the default resource group layout as mkfs would have done */
- compute_rgrp_layout(sdp, FALSE);
+ compute_rgrp_layout(sdp, TRUE);
build_rgrps(sdp, FALSE); /* FALSE = calc but don't write to disk. */
- *num_rgs = 0;
- log_debug( _("fs_total_size = 0x%llX blocks.\n"),
+ log_debug( _("fs_total_size = 0x%llx blocks.\n"),
(unsigned long long)sdp->device.length);
- /* ----------------------------------------------------------------- */
- /* Calculate how many RGs there are supposed to be based on the */
- /* rindex filesize. Remember that our trust level is open-minded */
- /* here. If the filesize of the rindex file is not a multiple of */
- /* our rindex structures, then something's wrong and we can't trust */
- /* the index. */
- /* ----------------------------------------------------------------- */
- *num_rgs = sdp->md.riinode->i_di.di_size / sizeof(struct gfs2_rindex);
- log_warn( _("L2: number of rgs in the index = %d.\n"), *num_rgs);
+ log_warn( _("L3: number of rgs in the index = %d.\n"), *num_rgs);
/* Move the rg list to the return list */
ret_list->next = sdp->rglist.next;
ret_list->prev = sdp->rglist.prev;
@@ -380,14 +668,14 @@ static int rewrite_rg_block(struct gfs2_sbd *sdp, struct rgrp_list *rg,
uint64_t errblock)
{
int x = errblock - rg->ri.ri_addr;
+ const char *typedesc = x ? "GFS2_METATYPE_RB" : "GFS2_METATYPE_RG";
- log_err( _("Block #%lld (0x%llx) (%d of %d) is neither"
- " GFS2_METATYPE_RB nor GFS2_METATYPE_RG.\n"),
+ log_err( _("Block #%lld (0x%llx) (%d of %d) is not %s.\n"),
(unsigned long long)rg->ri.ri_addr + x,
(unsigned long long)rg->ri.ri_addr + x,
- (int)x+1, (int)rg->ri.ri_length);
+ (int)x+1, (int)rg->ri.ri_length, typedesc);
if (query( _("Fix the Resource Group? (y/n)"))) {
- log_err( _("Attempting to repair the RG.\n"));
+ log_err( _("Attempting to repair the rgrp.\n"));
rg->bh[x] = bread(sdp, rg->ri.ri_addr + x);
if (x) {
struct gfs2_meta_header mh;
@@ -437,6 +725,7 @@ static int expect_rindex_sanity(struct gfs2_sbd *sdp, osi_list_t *ret_list,
memcpy(&exp->ri, &rgd->ri, sizeof(exp->ri));
memcpy(&exp->rg, &rgd->rg, sizeof(exp->rg));
exp->bits = NULL;
+ exp->bh = NULL;
gfs2_compute_bitstructs(sdp, exp);
osi_list_add_prev(&exp->list, ret_list);
}
@@ -445,21 +734,59 @@ static int expect_rindex_sanity(struct gfs2_sbd *sdp, osi_list_t *ret_list,
}
/*
+ * sort_rgrp_list - sort the rgrp list
+ *
+ * A bit crude, perhaps, but we're talking about thousands, not millions of
+ * entries to sort, and the list will be almost sorted anyway, so there
+ * should be very few swaps.
+ */
+static void sort_rgrp_list(osi_list_t *head)
+{
+ struct rgrp_list *thisr, *nextr;
+ osi_list_t *tmp, *x, *next;
+ int swaps;
+
+ while(1) {
+ swaps = 0;
+ osi_list_foreach_safe(tmp, head, x) {
+ next = tmp->next;
+ if (next == head) /* at the end */
+ break;
+ thisr = osi_list_entry(tmp, struct rgrp_list, list);
+ nextr = osi_list_entry(next, struct rgrp_list, list);
+ if (thisr->ri.ri_addr > nextr->ri.ri_addr) {
+ osi_list_del(next);
+ osi_list_add_prev(next, tmp);
+ swaps++;
+ }
+ }
+ if (!swaps)
+ break;
+ }
+}
+
+/*
* rg_repair - try to repair a damaged rg index (rindex)
* trust_lvl - This is how much we trust the rindex file.
* blind_faith means we take the rindex at face value.
* open_minded means it might be okay, but we should verify it.
* distrust means it's not to be trusted, so we should go to
* greater lengths to build it from scratch.
+ * indignation means we have corruption, but the file system
+ * was converted from GFS via gfs2_convert, and its rgrps are
+ * not on nice boundaries thanks to previous gfs_grow ops. Lovely.
*/
int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
{
- int error, discrepancies;
+ int error, discrepancies, percent;
osi_list_t expected_rglist;
int calc_rg_count = 0, rgcount_from_index, rg;
osi_list_t *exp, *act; /* expected, actual */
struct gfs2_rindex buf;
+ /* Free previous incarnations in memory, if any. */
+ gfs2_rgrp_free(&sdp->rglist);
+
if (trust_lvl == blind_faith)
return 0;
else if (trust_lvl == ye_of_little_faith) { /* if rindex seems sane */
@@ -470,8 +797,10 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
}
error = expect_rindex_sanity(sdp, &expected_rglist,
&calc_rg_count);
- if (error)
+ if (error) {
+ gfs2_rgrp_free(&expected_rglist);
return error;
+ }
} else if (trust_lvl == open_minded) { /* If we can't trust RG index */
/* Calculate our own RG index for comparison */
error = gfs2_rindex_calculate(sdp, &expected_rglist,
@@ -483,9 +812,19 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
}
else if (trust_lvl == distrust) { /* If we can't trust RG index */
error = gfs2_rindex_rebuild(sdp, &expected_rglist,
- &calc_rg_count);
+ &calc_rg_count, 0);
if (error) {
- log_crit( _("Error rebuilding rg list.\n"));
+ log_crit( _("Error rebuilding rgrp list.\n"));
+ gfs2_rgrp_free(&expected_rglist);
+ return -1;
+ }
+ sdp->rgrps = calc_rg_count;
+ }
+ else if (trust_lvl == indignation) { /* If we can't trust anything */
+ error = gfs2_rindex_rebuild(sdp, &expected_rglist,
+ &calc_rg_count, 1);
+ if (error) {
+ log_crit( _("Error rebuilding rgrp list.\n"));
gfs2_rgrp_free(&expected_rglist);
return -1;
}
@@ -503,13 +842,24 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
log_warn( _("L%d: number of rgs expected = %lld.\n"), trust_lvl + 1,
(unsigned long long)sdp->rgrps);
if (calc_rg_count != sdp->rgrps) {
- log_warn( _("L%d: They don't match; either (1) the fs was extended, (2) an odd\n"), trust_lvl + 1);
- log_warn( _("L%d: rg size was used, or (3) we have a corrupt rg index.\n"), trust_lvl + 1);
+ log_warn( _("L%d: They don't match; either (1) the fs was "
+ "extended, (2) an odd\n"), trust_lvl + 1);
+ log_warn( _("L%d: rgrp size was used, or (3) we have a corrupt "
+ "rg index.\n"), trust_lvl + 1);
gfs2_rgrp_free(&expected_rglist);
gfs2_rgrp_free(&sdp->rglist);
return -1;
}
/* ------------------------------------------------------------- */
+ /* Sort the rindex list. Older versions of gfs_grow got the */
+ /* rindex out of sorted order. But rebuilding the rindex from */
+ /* scratch will rebuild it in sorted order. */
+ /* The gfs2_grow program should, in theory, drop new rgrps into */
+ /* the rindex in sorted order, so this should only matter for */
+ /* gfs1 converted file systems. */
+ /* ------------------------------------------------------------- */
+ sort_rgrp_list(&sdp->rglist);
+ /* ------------------------------------------------------------- */
/* Now compare the rindex to what we think it should be. */
/* See how far off our expected values are. If too much, abort. */
/* The theory is: if we calculated the index to have 32 RGs and */
@@ -518,28 +868,52 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
/* ------------------------------------------------------------- */
discrepancies = 0;
for (rg = 0, act = sdp->rglist.next, exp = expected_rglist.next;
- act != &sdp->rglist && exp != &expected_rglist;
- act = act->next, exp = exp->next, rg++) {
+ act != &sdp->rglist && exp != &expected_rglist && !fsck_abort;
+ rg++) {
struct rgrp_list *expected, *actual;
expected = osi_list_entry(exp, struct rgrp_list, list);
actual = osi_list_entry(act, struct rgrp_list, list);
- if (!ri_equal(actual->ri, expected->ri, ri_addr) ||
- !ri_equal(actual->ri, expected->ri, ri_length) ||
+ if (actual->ri.ri_addr < expected->ri.ri_addr) {
+ act = act->next;
+ discrepancies++;
+ log_info(_("%d addr: 0x%llx < 0x%llx * mismatch\n"),
+ rg + 1, actual->ri.ri_addr,
+ expected->ri.ri_addr);
+ continue;
+ } else if (expected->ri.ri_addr < actual->ri.ri_addr) {
+ exp = exp->next;
+ discrepancies++;
+ log_info(_("%d addr: 0x%llx > 0x%llx * mismatch\n"),
+ rg + 1, actual->ri.ri_addr,
+ expected->ri.ri_addr);
+ continue;
+ }
+ if (!ri_equal(actual->ri, expected->ri, ri_length) ||
!ri_equal(actual->ri, expected->ri, ri_data0) ||
!ri_equal(actual->ri, expected->ri, ri_data) ||
!ri_equal(actual->ri, expected->ri, ri_bitbytes)) {
discrepancies++;
+ log_info(_("%d addr: 0x%llx 0x%llx * has mismatch\n"),
+ rg + 1, actual->ri.ri_addr,
+ expected->ri.ri_addr);
}
+ act = act->next;
+ exp = exp->next;
}
- if (trust_lvl < distrust && discrepancies > (trust_lvl * 8)) {
- log_warn( _("Level %d didn't work. Too many descepencies.\n"),
- trust_lvl + 1);
- log_warn( _("%d out of %d RGs did not match what was expected.\n"),
- discrepancies, rg);
- gfs2_rgrp_free(&expected_rglist);
- gfs2_rgrp_free(&sdp->rglist);
- return -1;
+ if (rg) {
+ /* Check to see if more than 2% of the rgrps are wrong. */
+ percent = (discrepancies * 100) / rg;
+ if (percent > BAD_RG_PERCENT_TOLERANCE) {
+ log_warn( _("Level %d didn't work. Too many "
+ "discrepancies.\n"), trust_lvl + 1);
+ log_warn( _("%d out of %d rgrps (%d percent) did not "
+ "match what was expected.\n"),
+ discrepancies, rg, percent);
+ gfs2_rgrp_free(&expected_rglist);
+ gfs2_rgrp_free(&sdp->rglist);
+ return -1;
+ }
}
/* ------------------------------------------------------------- */
/* Now compare the rindex to what we think it should be. */
@@ -547,17 +921,38 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
/* so look for index problems first before looking at the rgs. */
/* ------------------------------------------------------------- */
for (rg = 0, act = sdp->rglist.next, exp = expected_rglist.next;
- act != &sdp->rglist && exp != &expected_rglist;
- act = act->next, exp = exp->next, rg++) {
+ exp != &expected_rglist && !fsck_abort; rg++) {
struct rgrp_list *expected, *actual;
expected = osi_list_entry(exp, struct rgrp_list, list);
- actual = osi_list_entry(act, struct rgrp_list, list);
- ri_compare(rg, actual->ri, expected->ri, ri_addr, "llx", unsigned long long);
- ri_compare(rg, actual->ri, expected->ri, ri_length, "lx", unsigned long);
- ri_compare(rg, actual->ri, expected->ri, ri_data0, "llx", unsigned long long);
- ri_compare(rg, actual->ri, expected->ri, ri_data, "lx", unsigned long);
- ri_compare(rg, actual->ri, expected->ri, ri_bitbytes, "lx", unsigned long);
+
+ /* If we ran out of actual rindex entries due to rindex
+ damage, fill in a new one with the expected values. */
+ if (act == &sdp->rglist) { /* end of actual rindex */
+ log_err( _("Entry missing from rindex: 0x%llx\n"),
+ (unsigned long long)expected->ri.ri_addr);
+ actual = (struct rgrp_list *)
+ malloc(sizeof(struct rgrp_list));
+ if (!actual) {
+ log_err(_("Out of memory!\n"));
+ break;
+ }
+ memset(actual, 0, sizeof(struct rgrp_list));
+ osi_list_add_prev(&actual->list, &sdp->rglist);
+ rindex_modified = 1;
+ } else {
+ actual = osi_list_entry(act, struct rgrp_list, list);
+ ri_compare(rg, actual->ri, expected->ri, ri_addr,
+ "llx", unsigned long long);
+ ri_compare(rg, actual->ri, expected->ri, ri_length,
+ "lx", unsigned long);
+ ri_compare(rg, actual->ri, expected->ri, ri_data0,
+ "llx", unsigned long long);
+ ri_compare(rg, actual->ri, expected->ri, ri_data,
+ "lx", unsigned long);
+ ri_compare(rg, actual->ri, expected->ri, ri_bitbytes,
+ "lx", unsigned long);
+ }
/* If we modified the index, write it back to disk. */
if (rindex_modified) {
if (query( _("Fix the index? (y/n)"))) {
@@ -575,22 +970,27 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
/* Therefore, gfs2_compute_bitstructs might */
/* have malloced the wrong length for bitmap */
/* buffers. So we have to redo it. */
- if (actual->bits)
+ if (actual->bits) {
free(actual->bits);
+ actual->bits = NULL;
+ }
}
else
- log_err( _("RG index not fixed.\n"));
+ log_err( _("rindex not fixed.\n"));
gfs2_compute_bitstructs(sdp, actual);
rindex_modified = FALSE;
}
+ exp = exp->next;
+ if (act != &sdp->rglist)
+ act = act->next;
}
/* ------------------------------------------------------------- */
/* Read the real RGs and check their integrity. */
/* Now we can somewhat trust the rindex and the RG addresses, */
/* so let's read them in, check them and optionally fix them. */
/* ------------------------------------------------------------- */
- for (rg = 0, act = sdp->rglist.next; act != &sdp->rglist;
- act = act->next, rg++) {
+ for (rg = 0, act = sdp->rglist.next; act != &sdp->rglist &&
+ !fsck_abort; act = act->next, rg++) {
struct rgrp_list *rgd;
uint64_t prev_err = 0, errblock;
int i;
diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
index 9c69661..caffeb7 100644
--- a/gfs2/libgfs2/fs_geometry.c
+++ b/gfs2/libgfs2/fs_geometry.c
@@ -24,7 +24,7 @@
* Returns: the number of RGs
*/
-static uint64_t how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev, int rgsize_specified)
+uint64_t how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev, int rgsize_specified)
{
uint64_t nrgrp;
uint32_t rgblocks1, rgblocksn, bitblocks1, bitblocksn;
@@ -119,7 +119,8 @@ void compute_rgrp_layout(struct gfs2_sbd *sdp, int rgsize_specified)
nrgrp = rgrp + sdp->new_rgrps;
}
- log_info("\nNew resource groups:\n");
+ if (rgrp < nrgrp)
+ log_info("\nNew resource groups:\n");
for (; rgrp < nrgrp; rgrp++) {
rl = calloc(1, sizeof(struct rgrp_list));
if (rl == NULL) {
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 402a4f9..387e8a7 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -413,6 +413,8 @@ extern int gfs2_set_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, int state);
/* fs_geometry.c */
extern void rgblocks2bitblocks(unsigned int bsize, uint32_t *rgblocks,
uint32_t *bitblocks);
+extern uint64_t how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev,
+ int rgsize_specified);
extern void compute_rgrp_layout(struct gfs2_sbd *sdp, int rgsize_specified);
extern void build_rgrps(struct gfs2_sbd *sdp, int write);
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index b5e68b2..2a6fa3f 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -134,7 +134,15 @@ struct rgrp_list *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, uint64_t blk)
uint64_t gfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_list *rgd)
{
int x, length = rgd->ri.ri_length;
+ uint64_t max_rgrp_bitbytes, max_rgrp_len;
+ /* Max size of an rgrp is 2GB. Figure out how many blocks that is: */
+ max_rgrp_bitbytes = ((2147483648 / sdp->bsize) / GFS2_NBBY);
+ max_rgrp_len = max_rgrp_bitbytes / sdp->bsize;
+ if (!length && length > max_rgrp_len)
+ return -1;
+ if (gfs2_check_range(sdp, rgd->ri.ri_addr))
+ return -1;
for (x = 0; x < length; x++){
rgd->bh[x] = bread(sdp, rgd->ri.ri_addr + x);
if(gfs2_check_meta(rgd->bh[x],
@@ -151,7 +159,8 @@ uint64_t gfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_list *rgd)
}
}
- gfs2_rgrp_in(&rgd->rg, rgd->bh[0]);
+ if (rgd->bh && rgd->bh[0])
+ gfs2_rgrp_in(&rgd->rg, rgd->bh[0]);
return 0;
}
@@ -160,8 +169,10 @@ void gfs2_rgrp_relse(struct rgrp_list *rgd)
int x, length = rgd->ri.ri_length;
for (x = 0; x < length; x++) {
- brelse(rgd->bh[x]);
- rgd->bh[x] = NULL;
+ if (rgd->bh && rgd->bh[x]) {
+ brelse(rgd->bh[x]);
+ rgd->bh[x] = NULL;
+ }
}
}
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 70e9c82..995e503 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -182,10 +182,8 @@ int rindex_read(struct gfs2_sbd *sdp, int fd, int *count1, int *sane)
prev_rgd->length = prev_length;
}
- if(gfs2_compute_bitstructs(sdp, rgd)) {
+ if(gfs2_compute_bitstructs(sdp, rgd))
*sane = 0;
- return -1;
- }
(*count1)++;
prev_rgd = rgd;
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index e76affc..03eb57b 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -181,7 +181,7 @@ static void initialize_new_portion(struct gfs2_sbd *sdp, int *old_rg_count)
osi_list_del(head->next);
}
/* Issue a discard ioctl for the new portion */
- rl = osi_list_entry(&sdp->rglist.next, struct rgrp_list, list);
+ rl = osi_list_entry(sdp->rglist.next, struct rgrp_list, list);
discard_blocks(sdp->device_fd, rl->start * sdp->bsize,
(sdp->device.length - rl->start) * sdp->bsize);
/* Build the remaining resource groups */
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=75…
Commit: 753b6c506ed7caa8e39e5dcac676223378ccfbe2
Parent: 8cb4fbc7e7ffc16cfffcc1a14a3253830a77f69d
Author: Chris Feist <cfeist(a)redhat.com>
AuthorDate: Tue Feb 1 14:15:04 2011 -0600
Committer: Chris Feist <cfeist(a)redhat.com>
CommitterDate: Tue Feb 1 14:20:52 2011 -0600
cman: Added checkquorum script for self fencing
A checkquorum script has been added which when copied to the
/etc/watchdog.d directory will cause the machine to node to reboot
itself if it has lost quorum for ~60 seconds.
Resolves: rhbz#560700
---
cman/Makefile | 2 +-
cman/man/Makefile | 3 +-
cman/man/checkquorum.8 | 29 ++++++++++++++
cman/scripts/Makefile | 10 +++++
cman/scripts/checkquorum | 97 ++++++++++++++++++++++++++++++++++++++++++++++
make/install.mk | 4 ++
6 files changed, 143 insertions(+), 2 deletions(-)
diff --git a/cman/Makefile b/cman/Makefile
index ead0baa..1cf8bc9 100644
--- a/cman/Makefile
+++ b/cman/Makefile
@@ -1,4 +1,4 @@
include ../make/defines.mk
include $(OBJDIR)/make/passthrough.mk
-SUBDIRS=lib cman_tool daemon qdisk notifyd init.d man
+SUBDIRS=lib cman_tool daemon qdisk notifyd init.d man scripts
diff --git a/cman/man/Makefile b/cman/man/Makefile
index df20abb..f7fbebf 100644
--- a/cman/man/Makefile
+++ b/cman/man/Makefile
@@ -5,7 +5,8 @@ MANTARGET= \
qdiskd.8 \
mkqdisk.8 \
cmannotifyd.8 \
- cman_notify.8
+ cman_notify.8 \
+ checkquorum.8
include ../../make/defines.mk
include $(OBJDIR)/make/install.mk
diff --git a/cman/man/checkquorum.8 b/cman/man/checkquorum.8
new file mode 100644
index 0000000..96f61f0
--- /dev/null
+++ b/cman/man/checkquorum.8
@@ -0,0 +1,29 @@
+.TH "checkquorum" "8" "February 2011" "" "Check Quorum Watchdog Script"
+.SH "NAME"
+checkquorum \- Check Quorum Watchdog Script
+.SH "SYNOPSIS"
+\fBcheckquorum
+.SH "DESCRIPTION"
+.PP
+The \fBcheckquorum\fP watchdog script, when copied to the
+.IR /etc/watchdog.d
+directory and after enabling/starting the watchdog daemon causes the node to reboot if quorum is
+lost and not regained within a user configurable amount of time (default: 60 seconds).
+.SH "OPTIONS"
+The checkquorum script includes several options which can be set by editing
+the script with a text editor.
+.TP
+.BR $wait_time
+Amount of time in seconds to wait after quorum is lost before trigger a reboot
+(Default: 60 seconds).
+.TP
+.BR $hardreboot
+Instantly reboot the machine without cleanly shutting down the system.
+Useful when the machine may hang on reboot. Set to 1 to hard reboot the
+system, 0 to do a normal reboot.
+.SH "NOTES"
+\fBcheckquorum\fP should never be called outside of watchdog except for
+debugging purposes.
+
+.SH "SEE ALSO"
+watchdog(8)
diff --git a/cman/scripts/Makefile b/cman/scripts/Makefile
new file mode 100644
index 0000000..b4866c8
--- /dev/null
+++ b/cman/scripts/Makefile
@@ -0,0 +1,10 @@
+SHAREDIRTEX=checkquorum
+
+include ../../make/defines.mk
+include $(OBJDIR)/make/clean.mk
+include $(OBJDIR)/make/install.mk
+include $(OBJDIR)/make/uninstall.mk
+
+all:
+
+clean: generalclean
diff --git a/cman/scripts/checkquorum b/cman/scripts/checkquorum
new file mode 100755
index 0000000..43cbc6d
--- /dev/null
+++ b/cman/scripts/checkquorum
@@ -0,0 +1,97 @@
+#!/usr/bin/perl -w
+# Quorum detection watchdog script
+#
+# This script will return -2 if the node had quorum at one point
+# and then subsequently lost it
+#
+# Copyright 2011 Red Hat, Inc.
+
+# Amount of time in seconds to wait after quorum is lost to fail script
+$wait_time = 60;
+
+# Hard Reboot the system (doesn't cleanly shut down the system)
+$hardreboot = 0;
+
+# Location of temporary file to capture timeouts
+$timerfile = "/var/run/cluster/checkquorum-timer";
+
+# Enable debug messages (0 to disable, 1 to enable)
+$debugval = 0;
+
+# If command is called attempting to 'repair' we automatically fail
+if (($#ARGV != -1) && ($ARGV[0] eq "repair")) {
+ debug ("Failing on repair\n");
+ exit 1;
+}
+
+if (!quorum()) {
+ if (has_quorum_already_been_formed()) {
+ debug("Quorum has already existed, node can be self fenced!\n");
+ if (-e $timerfile) {
+ $tf = open (FILE, "$timerfile");
+ $time = <FILE>;
+ close (FILE);
+ $timediff = time() - $time;
+ if ($timediff >= $wait_time) {
+ self_fence()
+ } else {
+ $remaining = $wait_time - $timediff;
+ debug("Time has not exceeded wait time ($remaining seconds remaining).\n");
+ }
+ } else {
+ debug("Creating timer file...\n");
+ $tf = open (FILE, ">$timerfile");
+ print FILE time();
+ close (FILE);
+ }
+ } else {
+ debug("This is a new startup no self-fencing will occur.\n");
+ `rm -f $timerfile`;
+ }
+} else {
+ debug("Quorum exists, no self-fencing should occur.\n");
+ `rm -f $timerfile`;
+}
+
+sub has_quorum_already_been_formed {
+ $oe = `/usr/sbin/corosync-objctl 2>&1 | grep -E "runtime.totem.pg.mrp.srp.operational_entered|Could not initialize objdb library|Cannot connect to quorum service" `;
+ if ($oe =~ /^Could not/ || $oe =~ /^Cannot/) {
+ debug("corosync is not running\n");
+ exit 0;
+ }
+ $oe =~ s/.*=//;
+ if ($oe > 1) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub quorum {
+ $cq = `corosync-quorumtool -s 2>&1 | grep -E "Quorate:|Cannot connect to quorum service"`;
+ if ($cq =~ /Cannot connect to quorum service/) {
+ debug("corosync is not running\n");
+ exit 0;
+ }
+ $cq =~ s/Quorate: *//;
+ chomp ($cq);
+ return 1 if ($cq eq "Yes");
+ return 0;
+}
+
+sub self_fence {
+ debug("Self fencing commencing...\n");
+ `rm -f $timerfile`;
+ if ($hardreboot == 1) {
+ `echo 1 > /proc/sys/kernel/sysrq`;
+ `echo b > /proc/sysrq-trigger`;
+ }
+ exit -2;
+}
+
+sub debug {
+ $out = pop(@_);
+ if ($debugval) {
+ print $out;
+ }
+}
diff --git a/make/install.mk b/make/install.mk
index 3f23bca..fa6ac92 100644
--- a/make/install.mk
+++ b/make/install.mk
@@ -66,6 +66,10 @@ ifdef PKGCONF
install -d ${pkgconfigdir}
install -m644 ${PKGCONF} ${pkgconfigdir}
endif
+ifdef SHAREDIRTEX
+ install -d ${sharedir}
+ install -m755 ${SHAREDIRTEX} ${sharedir}
+endif
ifdef SHAREDIRT
install -d ${sharedir}
install -m644 ${SHAREDIRT} ${sharedir}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c2…
Commit: c2fa8fe7c8f2a3cbf1023a170f3f78a8de559b7a
Parent: 109a4f729592e2f9039ec369df440cbb21a078c7
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Sep 8 16:20:19 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Tue Feb 1 12:32:16 2011 -0500
rgmanager: Do not fail service if non-critical resources fail to stop
During non-critical component recovery (e.g. stop and leave dead),
rgmanager stops parts up to the __independent_subtree="2" flag.
If any stop operations fail during this phase, rgmanager should
ignore them since the resources are non-critical.
During a normal relocation/restart/enable/disable/etc, these
operations are critical and a fail to stop will result in the
service being placed in to the failed state.
Resolves: rhbz#634277
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index ab0e20d..8719791 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -1510,6 +1510,21 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
node->rn_flags &= ~RF_NEEDSTOP;
rv |= res_exec(node, op, NULL, 0);
+ if (node->rn_flags & RF_QUIESCE) {
+ /* Non-critical resources = do not fail
+ * service if the resource fails to stop
+ */
+ if (rv & SFL_FAILURE) {
+ logt_print(LOG_WARNING, "Failure to stop %s:%s"
+ " during non-critical recovery "
+ "operation\n",
+ node->rn_resource->r_rule->rr_type,
+ primary_attr_value(
+ node->rn_resource));
+ rv &= ~SFL_FAILURE;
+ }
+ }
+
if (rv == 0 && (node->rn_state == RES_STARTED ||
node->rn_state == RES_FAILED)) {
assert(node->rn_resource->r_incarnations >= 0);
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0a…
Commit: 0a4a433df0274085d6cb530c529740b77fbb93f0
Parent: b0aa94c16ee8b018858c138c8b997e1673828610
Author: Jeremy Miller <csf1dsh(a)ups.com>
AuthorDate: Tue Feb 1 11:52:54 2011 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Tue Feb 1 11:54:44 2011 -0500
qdisk: Informational syslog message indicating label overrides device
When user specifies both quorum label and quorum device (ccs allows this), the
user isn't notified that the label will override the device when searching
through disks for the quorum partition. This can mislead the user into
thinking that qdiskd will in fact use the quorum device they specified.
This can have serious consequences when the user intends qdiskd to use a
specified a multipath device such as "/dev/mapper/qdisk", but in actuality
qdiskd will just use the first device it finds with matching user specified
label (for example "/dev/dm-17"). According to Red Hat documentation, when
using multipath, one should always use /dev/mapper/xxx devices to ensure
proper path failover, rather than /dev/dm-xx or /dev/mpath/xxx devices.
Resolves: rhbz#635413
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/qdisk/main.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index 617a705..ebdb018 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -1746,6 +1746,11 @@ get_static_config_data(qd_ctx *ctx, int ccsfd)
snprintf(query, sizeof(query), "/cluster/quorumd/@label");
if (ccs_get(ccsfd, query, &val) == 0) {
ctx->qc_label = val;
+ /* courtesy info message */
+ if (ctx->qc_device)
+ logt_print(LOG_INFO, "Quorum Label (%s) will be used to "
+ "locate quorum partition, overriding Quorum Device\n",
+ ctx->qc_label);
}
if (!ctx->qc_device && !ctx->qc_label) {
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8c…
Commit: 8cb4fbc7e7ffc16cfffcc1a14a3253830a77f69d
Parent: 5822073b63d1b83af623bb3c72dccc97f4eb2e27
Author: Jeremy Miller <csf1dsh(a)ups.com>
AuthorDate: Tue Feb 1 11:52:54 2011 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Tue Feb 1 11:52:54 2011 -0500
qdisk: Informational syslog message indicating label overrides device
When user specifies both quorum label and quorum device (ccs allows this), the
user isn't notified that the label will override the device when searching
through disks for the quorum partition. This can mislead the user into
thinking that qdiskd will in fact use the quorum device they specified.
This can have serious consequences when the user intends qdiskd to use a
specified a multipath device such as "/dev/mapper/qdisk", but in actuality
qdiskd will just use the first device it finds with matching user specified
label (for example "/dev/dm-17"). According to Red Hat documentation, when
using multipath, one should always use /dev/mapper/xxx devices to ensure
proper path failover, rather than /dev/dm-xx or /dev/mpath/xxx devices.
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/qdisk/main.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index 617a705..ebdb018 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -1746,6 +1746,11 @@ get_static_config_data(qd_ctx *ctx, int ccsfd)
snprintf(query, sizeof(query), "/cluster/quorumd/@label");
if (ccs_get(ccsfd, query, &val) == 0) {
ctx->qc_label = val;
+ /* courtesy info message */
+ if (ctx->qc_device)
+ logt_print(LOG_INFO, "Quorum Label (%s) will be used to "
+ "locate quorum partition, overriding Quorum Device\n",
+ ctx->qc_label);
}
if (!ctx->qc_device && !ctx->qc_label) {