Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=98…
Commit: 98ea28be22109e64107db447a829e0b8a42863b2
Parent: 99345341cc709bbb794ac1f2711b93dda349fc37
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri Jan 21 08:13:08 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri Jan 21 08:17:30 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#667769
---
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=99…
Commit: 99345341cc709bbb794ac1f2711b93dda349fc37
Parent: be158e9bd1c3c99475ff4f213c19b1732ab0f14d
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Jan 20 15:09:14 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 20 15:09:14 2011 -0600
fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap
The problem is that the block map is not set at the point of
time when the master and root dinodes are checked. So fsck
sees the discrepancy between the on-disk bitmap (which is
correct) and the in-core blockmap (which hasn't been set
yet for these two system dinodes). So it complains improperly.
This is a simple fix. Long ago, I wrote a function called
resuscitate_metalist whose purpose was to make sure dinodes
get marked "in use" for each system dinode. It's called by
function check_system_inode, and by way of check_metalist.
The function is called for root and master, and therefore
all the system dinodes _within_ those directories are
marked properly in the block map, but nothing ever bothers
to mark the directories themselves. (Side note: the root
directory doesn't have system dinodes like master, so that's
moot).
The solution (this patch) is to set the block map
accordingly, prior to the other checks. Since those two
dinodes have no parent, nothing else is going to do it for
them.
rhbz#642797
---
gfs2/fsck/pass1.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 3bdcf60..bced051 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -1305,11 +1305,21 @@ static int check_system_inodes(struct gfs2_sbd *sdp)
/*******************************************************************
******* Check the system inode integrity *************
*******************************************************************/
+ /* Mark the master system dinode as a "dinode" in the block map.
+ All other system dinodes in master will be taken care of by function
+ resuscitate_metalist. But master won't since it has no parent.*/
+ fsck_blockmap_set(sdp->master_dir,
+ sdp->master_dir->i_di.di_num.no_addr,
+ "master", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->master_dir, "master", build_master,
gfs2_inode_dir)) {
stack;
return -1;
}
+ /* Mark the root dinode as a "dinode" in the block map as we did
+ for master, since it has no parent. */
+ fsck_blockmap_set(sdp->md.rooti, sdp->md.rooti->i_di.di_num.no_addr,
+ "root", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->md.rooti, "root", build_root,
gfs2_inode_dir)) {
stack;
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=57…
Commit: 5710603c4af1d832f21a7583da5bd834606c4995
Parent: 679d1f0a1e95bae746d22889fd731fee979676ee
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Jan 20 14:25:55 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 20 14:29:46 2011 -0600
fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap
The problem is that the block map is not set at the point of
time when the master and root dinodes are checked. So fsck
sees the discrepancy between the on-disk bitmap (which is
correct) and the in-core blockmap (which hasn't been set
yet for these two system dinodes). So it complains improperly.
This is a simple fix. Long ago, I wrote a function called
resuscitate_metalist whose purpose was to make sure dinodes
get marked "in use" for each system dinode. It's called by
function check_system_inode, and by way of check_metalist.
The function is called for root and master, and therefore
all the system dinodes _within_ those directories are
marked properly in the block map, but nothing ever bothers
to mark the directories themselves. (Side note: the root
directory doesn't have system dinodes like master, so that's
moot).
The solution (this patch) is to set the block map
accordingly, prior to the other checks. Since those two
dinodes have no parent, nothing else is going to do it for
them.
rhbz#663037
---
gfs2/fsck/pass1.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 6613bd1..a7eb96d 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -1293,11 +1293,21 @@ static int check_system_inodes(struct gfs2_sbd *sdp)
/*******************************************************************
******* Check the system inode integrity *************
*******************************************************************/
+ /* Mark the master system dinode as a "dinode" in the block map.
+ All other system dinodes in master will be taken care of by function
+ resuscitate_metalist. But master won't since it has no parent.*/
+ fsck_blockmap_set(sdp->master_dir,
+ sdp->master_dir->i_di.di_num.no_addr,
+ "master", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->master_dir, "master", build_master,
gfs2_inode_dir)) {
stack;
return -1;
}
+ /* Mark the root dinode as a "dinode" in the block map as we did
+ for master, since it has no parent. */
+ fsck_blockmap_set(sdp->md.rooti, sdp->md.rooti->i_di.di_num.no_addr,
+ "root", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->md.rooti, "root", build_root,
gfs2_inode_dir)) {
stack;
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: fdc45edc17d329f966acac1b0832a437ba8c6a3e
Parent: a93b053d08c2173ad3c834c8b73c9831aa8f514a
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Jan 20 14:25:55 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 20 14:33:03 2011 -0600
fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap
The problem is that the block map is not set at the point of
time when the master and root dinodes are checked. So fsck
sees the discrepancy between the on-disk bitmap (which is
correct) and the in-core blockmap (which hasn't been set
yet for these two system dinodes). So it complains improperly.
This is a simple fix. Long ago, I wrote a function called
resuscitate_metalist whose purpose was to make sure dinodes
get marked "in use" for each system dinode. It's called by
function check_system_inode, and by way of check_metalist.
The function is called for root and master, and therefore
all the system dinodes _within_ those directories are
marked properly in the block map, but nothing ever bothers
to mark the directories themselves. (Side note: the root
directory doesn't have system dinodes like master, so that's
moot).
The solution (this patch) is to set the block map
accordingly, prior to the other checks. Since those two
dinodes have no parent, nothing else is going to do it for
them.
rhbz#663037
---
gfs2/fsck/pass1.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 96c2310..0134941 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -1296,11 +1296,21 @@ static int check_system_inodes(struct gfs2_sbd *sdp)
/*******************************************************************
******* Check the system inode integrity *************
*******************************************************************/
+ /* Mark the master system dinode as a "dinode" in the block map.
+ All other system dinodes in master will be taken care of by function
+ resuscitate_metalist. But master won't since it has no parent.*/
+ fsck_blockmap_set(sdp->master_dir,
+ sdp->master_dir->i_di.di_num.no_addr,
+ "master", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->master_dir, "master", build_master,
gfs2_inode_dir)) {
stack;
return -1;
}
+ /* Mark the root dinode as a "dinode" in the block map as we did
+ for master, since it has no parent. */
+ fsck_blockmap_set(sdp->md.rooti, sdp->md.rooti->i_di.di_num.no_addr,
+ "root", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->md.rooti, "root", build_root,
gfs2_inode_dir)) {
stack;
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: 39e735e3091706af66ab7bd56135eee441878d51
Parent: 86f046acd2be7623c6966ceea9ee922c239a88b2
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Jan 20 13:38:51 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Jan 20 13:38:51 2011 +0100
fence_eaton_snmp: New fence agent for Eaton devices
Fence agent for Eaton Managed ePDU (http://www.epdu.com)
Developed by Arnaud Quette <aquette.dev(a)gmail.com>
---
configure.ac | 1 +
fence/agents/Makefile.am | 1 +
fence/agents/eaton_snmp/Makefile.am | 16 +++
fence/agents/eaton_snmp/README | 20 +++
fence/agents/eaton_snmp/fence_eaton_snmp.py | 177 +++++++++++++++++++++++++++
5 files changed, 215 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index fd441e7..639769f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,6 +224,7 @@ AC_CONFIG_FILES([Makefile
fence/agents/cpint/Makefile
fence/agents/drac/Makefile
fence/agents/drac5/Makefile
+ fence/agents/eaton_snmp/Makefile
fence/agents/egenera/Makefile
fence/agents/eps/Makefile
fence/agents/ibmblade/Makefile
diff --git a/fence/agents/Makefile.am b/fence/agents/Makefile.am
index 3a91ed4..945b49b 100644
--- a/fence/agents/Makefile.am
+++ b/fence/agents/Makefile.am
@@ -13,6 +13,7 @@ SUBDIRS = lib \
cpint \
drac \
drac5 \
+ eaton_snmp \
egenera \
eps \
ibmblade \
diff --git a/fence/agents/eaton_snmp/Makefile.am b/fence/agents/eaton_snmp/Makefile.am
new file mode 100644
index 0000000..dad91c9
--- /dev/null
+++ b/fence/agents/eaton_snmp/Makefile.am
@@ -0,0 +1,16 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+TARGET = fence_eaton_snmp
+
+EXTRA_DIST = $(TARGET).py \
+ README
+
+sbin_SCRIPTS = $(TARGET)
+
+dist_man_MANS = $(TARGET).8
+
+include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fenceman.mk
+
+clean-local: clean-man
+ rm -f $(TARGET)
diff --git a/fence/agents/eaton_snmp/README b/fence/agents/eaton_snmp/README
new file mode 100644
index 0000000..82619d7
--- /dev/null
+++ b/fence/agents/eaton_snmp/README
@@ -0,0 +1,20 @@
+This is an snmp based fence agent for Eaton power distribution units to be used
+with RHEL4 Red Hat Cluster Suite.
+
+In order to use this agent, you will need to have net-snmp-utils installed
+on every node in your cluster. net-snmp-utils is scheduled for inclusion
+in the base RHEL distribution for Update 4, and is yummable in FC5.
+
+To use the agent, cp the agent to the /sbin directory on every
+cluster node.
+
+Then define a <fencedevice> in the cluster.conf file with
+agent="fence_eaton_snmp" as an attribute, and use it that way.
+Note, please, that the GUI does not support this agent yet, and you will have
+to edit your cluster.conf by hand and then propagate it yourself. If you need
+help with this, email me at the address below.
+
+The interface for the fence_eaton_snmp agent is identical to the existing
+fence_apc_snmp agent, upon which it has been derived.
+
+--Arnaud Quette - ArnaudQuette(a)Eaton.com
diff --git a/fence/agents/eaton_snmp/fence_eaton_snmp.py b/fence/agents/eaton_snmp/fence_eaton_snmp.py
new file mode 100644
index 0000000..b02cfd1
--- /dev/null
+++ b/fence/agents/eaton_snmp/fence_eaton_snmp.py
@@ -0,0 +1,177 @@
+#!/usr/bin/python
+
+# The Following agent has been tested on:
+# - Eaton ePDU managed - SNMP v1
+
+import sys, re, pexpect
+sys.path.append("@FENCEAGENTSLIBDIR@")
+from fencing import *
+from fencing_snmp import *
+
+#BEGIN_VERSION_GENERATION
+RELEASE_VERSION="Eaton SNMP fence agent"
+REDHAT_COPYRIGHT=""
+BUILD_DATE=""
+#END_VERSION_GENERATION
+
+### CONSTANTS ###
+# oid defining fence device
+OID_SYS_OBJECT_ID='.1.3.6.1.2.1.1.2.0'
+
+### GLOBAL VARIABLES ###
+# Device - see EatonManagedePDU
+device=None
+
+# Port ID
+port_id=None
+# Switch ID
+switch_id=None
+
+# Classes describing Device params
+class EatonManagedePDU:
+ status_oid= '.1.3.6.1.4.1.534.6.6.6.1.2.2.1.3.%d'
+ control_oid= '.1.3.6.1.4.1.534.6.6.6.1.2.2.1.3.%d'
+ outlet_table_oid='.1.3.6.1.4.1.534.6.6.6.1.2.2.1.1'
+ ident_str="Eaton Managed ePDU"
+ state_off=0
+ state_on=1
+ state_cycling=2
+ turn_off=0
+ turn_on=1
+ turn_cycle=2
+ # FIXME: what's this?
+ has_switches=False
+
+### FUNCTIONS ###
+def eaton_set_device(conn,options):
+ global device
+
+ agents_dir={'.1.3.6.1.4.1.534.6.6.6':EatonManagedePDU}
+
+ # First resolve type of Eaton
+ eaton_type=conn.walk(OID_SYS_OBJECT_ID)
+
+ if (not ((len(eaton_type)==1) and (agents_dir.has_key(eaton_type[0][1])))):
+ eaton_type=[[None,None]]
+
+ device=agents_dir[eaton_type[0][1]]
+
+ conn.log_command("Trying %s"%(device.ident_str))
+
+def eaton_resolv_port_id(conn,options):
+ global port_id,switch_id,device
+
+ if (device==None):
+ eaton_set_device(conn,options)
+
+ # Now we resolv port_id/switch_id
+ if ((options["-n"].isdigit()) and ((not device.has_switches) or (options["-s"].isdigit()))):
+ port_id=int(options["-n"])
+
+ if (device.has_switches):
+ switch_id=int(options["-s"])
+ else:
+ table=conn.walk(device.outlet_table_oid,30)
+
+ for x in table:
+ if (x[1].strip('"')==options["-n"]):
+ t=x[0].split('.')
+ if (device.has_switches):
+ port_id=int(t[len(t)-1])
+ switch_id=int(t[len(t)-3])
+ else:
+ port_id=int(t[len(t)-1])
+
+ if (port_id==None):
+ fail_usage("Can't find port with name %s!"%(options["-n"]))
+
+def get_power_status(conn,options):
+ global port_id,switch_id,device
+
+ if (port_id==None):
+ eaton_resolv_port_id(conn,options)
+
+ oid=((device.has_switches) and device.status_oid%(switch_id,port_id) or device.status_oid%(port_id))
+
+ (oid,status)=conn.get(oid)
+ return (status==str(device.state_on) and "on" or "off")
+
+def set_power_status(conn, options):
+ global port_id,switch_id,device
+
+ if (port_id==None):
+ eaton_resolv_port_id(conn,options)
+
+ oid=((device.has_switches) and device.control_oid%(switch_id,port_id) or device.control_oid%(port_id))
+
+ conn.set(oid,(options["-o"]=="on" and device.turn_on or device.turn_off))
+
+
+def get_outlets_status(conn, options):
+ global device
+
+ result={}
+
+ if (device==None):
+ eaton_set_device(conn,options)
+
+ res_ports=conn.walk(device.outlet_table_oid,30)
+
+ for x in res_ports:
+ t=x[0].split('.')
+
+ port_num=((device.has_switches) and "%s:%s"%(t[len(t)-3],t[len(t)-1]) or "%s"%(t[len(t)-1]))
+
+ port_name=x[1].strip('"')
+ port_status=""
+ result[port_num]=(port_name,port_status)
+
+ return result
+
+# Define new options
+def eaton_snmp_define_defaults():
+ all_opt["snmp_version"]["default"]="1"
+ all_opt["community"]["default"]="private"
+
+# Main agent method
+def main():
+ device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
+ "action", "ipaddr", "login", "passwd", "passwd_script",
+ "test", "port", "separator", "no_login", "no_password",
+ "snmp_version", "community", "snmp_auth_prot", "snmp_sec_level",
+ "snmp_priv_prot", "snmp_priv_passwd", "snmp_priv_passwd_script",
+ "udpport","inet4_only","inet6_only",
+ "power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
+
+ atexit.register(atexit_handler)
+
+ snmp_define_defaults ()
+ eaton_snmp_define_defaults()
+
+ options=check_input(device_opt,process_input(device_opt))
+
+ ## Support for -n [switch]:[plug] notation that was used before
+ if ((options.has_key("-n")) and (-1 != options["-n"].find(":"))):
+ (switch, plug) = options["-n"].split(":", 1)
+ if ((switch.isdigit()) and (plug.isdigit())):
+ options["-s"] = switch
+ options["-n"] = plug
+
+ if (not (options.has_key("-s"))):
+ options["-s"]="1"
+
+ docs = { }
+ docs["shortdesc"] = "Fence agent for Eaton over SNMP"
+ docs["longdesc"] = "fence_eaton_snmp is an I/O Fencing agent \
+which can be used with the Eaton network power switch. It logs \
+into a device via SNMP and reboots a specified outlet. It supports \
+SNMP v1 and v3 with all combinations of authenticity/privacy settings."
+ docs["vendorurl"] = "http://powerquality.eaton.com"
+ show_docs(options, docs)
+
+ # Operate the fencing device
+ result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)
+
+ sys.exit(result)
+if __name__ == "__main__":
+ main()