cluster: STABLE3 - config: Update LDIF schema based on recent RelaxNG changes
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 66bca4ef66d93c8bd0ce12915698e32cb2b16654
Parent: e8520c102e6e5fa6ffbb9614592cf9344a4be70f
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Feb 10 13:30:56 2010 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Wed Feb 10 13:30:56 2010 -0500
config: Update LDIF schema based on recent RelaxNG changes
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
config/plugins/ldap/99cluster.ldif | 86 ++++++++++++++++++++++-------------
config/plugins/ldap/ldap-base.csv | 9 +++-
2 files changed, 61 insertions(+), 34 deletions(-)
diff --git a/config/plugins/ldap/99cluster.ldif b/config/plugins/ldap/99cluster.ldif
index 610a02f..4039bb6 100644
--- a/config/plugins/ldap/99cluster.ldif
+++ b/config/plugins/ldap/99cluster.ldif
@@ -1,4 +1,4 @@
-# Auto-generated @ 2010-01-20 16:38:44
+# Auto-generated @ 2010-02-10 13:29:29
dn: cn=schema
attributeTypes: (
1.3.6.1.4.1.2312.8.1.1.1 NAME 'rhcsConfig-version'
@@ -583,175 +583,187 @@ attributeTypes: (
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.59 NAME 'rhcsExec'
+ 1.3.6.1.4.1.2312.8.1.1.63 NAME 'rhcsIp-family'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.60 NAME 'rhcsVmware-type'
+ 1.3.6.1.4.1.2312.8.1.1.252 NAME 'rhcsIpport'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.52 NAME 'rhcsSecure'
+ 1.3.6.1.4.1.2312.8.1.1.66 NAME 'rhcsRetrans'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.61 NAME 'rhcsVmware-datacenter'
+ 1.3.6.1.4.1.2312.8.1.1.69 NAME 'rhcsDomain'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.53 NAME 'rhcsVerbose'
+ 1.3.6.1.4.1.2312.8.1.1.71 NAME 'rhcsTimeout'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.245 NAME 'rhcsVersion'
+ 1.3.6.1.4.1.2312.8.1.1.270 NAME 'rhcsSerial-device'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.246 NAME 'rhcsHelp'
+ 1.3.6.1.4.1.2312.8.1.1.271 NAME 'rhcsSerial-params'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.247 NAME 'rhcsSeparator'
+ 1.3.6.1.4.1.2312.8.1.1.272 NAME 'rhcsChannel-address'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.57 NAME 'rhcsPartition'
+ 1.3.6.1.4.1.2312.8.1.1.59 NAME 'rhcsExec'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.58 NAME 'rhcsManaged'
+ 1.3.6.1.4.1.2312.8.1.1.60 NAME 'rhcsVmware-type'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.248 NAME 'rhcsHmc-version'
+ 1.3.6.1.4.1.2312.8.1.1.52 NAME 'rhcsSecure'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.249 NAME 'rhcsCmd-prompt'
+ 1.3.6.1.4.1.2312.8.1.1.61 NAME 'rhcsVmware-datacenter'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.250 NAME 'rhcsInet4-only'
+ 1.3.6.1.4.1.2312.8.1.1.53 NAME 'rhcsVerbose'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.251 NAME 'rhcsInet6-only'
+ 1.3.6.1.4.1.2312.8.1.1.245 NAME 'rhcsVersion'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.252 NAME 'rhcsIpport'
+ 1.3.6.1.4.1.2312.8.1.1.246 NAME 'rhcsHelp'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.55 NAME 'rhcsIdentity-file'
+ 1.3.6.1.4.1.2312.8.1.1.247 NAME 'rhcsSeparator'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.253 NAME 'rhcsSnmp-version'
+ 1.3.6.1.4.1.2312.8.1.1.57 NAME 'rhcsPartition'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.254 NAME 'rhcsCommunity'
+ 1.3.6.1.4.1.2312.8.1.1.58 NAME 'rhcsManaged'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.255 NAME 'rhcsSnmp-auth-prot'
+ 1.3.6.1.4.1.2312.8.1.1.248 NAME 'rhcsHmc-version'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.256 NAME 'rhcsSnmp-sec-level'
+ 1.3.6.1.4.1.2312.8.1.1.249 NAME 'rhcsCmd-prompt'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.257 NAME 'rhcsSnmp-priv-prot'
+ 1.3.6.1.4.1.2312.8.1.1.250 NAME 'rhcsInet4-only'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.258 NAME 'rhcsSnmp-priv-passwd'
+ 1.3.6.1.4.1.2312.8.1.1.251 NAME 'rhcsInet6-only'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.259 NAME 'rhcsSnmp-priv-passwd-script'
+ 1.3.6.1.4.1.2312.8.1.1.55 NAME 'rhcsIdentity-file'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.260 NAME 'rhcsUdpport'
+ 1.3.6.1.4.1.2312.8.1.1.253 NAME 'rhcsSnmp-version'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.63 NAME 'rhcsIp-family'
+ 1.3.6.1.4.1.2312.8.1.1.254 NAME 'rhcsCommunity'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.65 NAME 'rhcsMulticast-ttl'
+ 1.3.6.1.4.1.2312.8.1.1.255 NAME 'rhcsSnmp-auth-prot'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.66 NAME 'rhcsRetrans'
+ 1.3.6.1.4.1.2312.8.1.1.256 NAME 'rhcsSnmp-sec-level'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.69 NAME 'rhcsDomain'
+ 1.3.6.1.4.1.2312.8.1.1.257 NAME 'rhcsSnmp-priv-prot'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
)
attributeTypes: (
- 1.3.6.1.4.1.2312.8.1.1.71 NAME 'rhcsTimeout'
+ 1.3.6.1.4.1.2312.8.1.1.258 NAME 'rhcsSnmp-priv-passwd'
+ EQUALITY caseExactIA5Match
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
+ SINGLE-VALUE
+ )
+attributeTypes: (
+ 1.3.6.1.4.1.2312.8.1.1.259 NAME 'rhcsSnmp-priv-passwd-script'
+ EQUALITY caseExactIA5Match
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
+ SINGLE-VALUE
+ )
+attributeTypes: (
+ 1.3.6.1.4.1.2312.8.1.1.260 NAME 'rhcsUdpport'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE
@@ -925,6 +937,12 @@ attributeTypes: (
SINGLE-VALUE
)
attributeTypes: (
+ 1.3.6.1.4.1.2312.8.1.1.273 NAME 'rhcsInterface'
+ EQUALITY caseExactIA5Match
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
+ SINGLE-VALUE
+ )
+attributeTypes: (
1.3.6.1.4.1.2312.8.1.1.125 NAME 'rhcsRef'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
@@ -1616,7 +1634,7 @@ objectClasses: (
objectClasses: (
1.3.6.1.4.1.2312.8.1.2.5 NAME 'rhcsFencedevice' SUP top STRUCTURAL
MUST ( rhcsAgent $ name )
- MAY ( rhcsRibcl $ rhcsSsl $ rhcsIo-fencing $ rhcsSwitch $ rhcsModule-name $ rhcsDrac-version $ rhcsMethod $ rhcsCipher $ rhcsTimeout $ rhcsUse-uuid $ rhcsDomain $ rhcsKey-file $ rhcsHash $ rhcsRetrans $ rhcsMulticast-ttl $ rhcsMulticast-address $ rhcsIp-family $ rhcsUdpport $ rhcsSnmp-priv-passwd-script $ rhcsSnmp-priv-passwd $ rhcsSnmp-priv-prot $ rhcsSnmp-sec-level $ rhcsSnmp-auth-prot $ rhcsCommunity $ rhcsSnmp-version $ rhcsIdentity-file $ rhcsIpport $ rhcsInet6-only $ rhcsInet4-only $ rhcsCmd-prompt $ rhcsHmc-version $ rhcsManaged $ rhcsPartition $ rhcsSeparator $ rhcsHelp $ rhcsVersion $ rhcsDebug $ rhcsVerbose $ rhcsVmware-datacenter $ rhcsSecure $ rhcsVmware-type $ rhcsExec $ rhcsOption $ rhcsRpowerpath $ rhcsCserver $ rhcsServers $ rhcsAptpl $ rhcsLogfile $ rhcsAction $ rhcsDevices $ rhcsKey $ rhcsNodename $ rhcsLanplus $ rhcsAuth $ rhcsPasswd-script $ rhcsPasswd $ rhcsLogin $ rhcsIpaddr $ rhcsPort $ rhcsDevice )
+ MAY ( rhcsRibcl $ rhcsSsl $ rhcsIo-fencing $ rhcsSwitch $ rhcsModule-name $ rhcsDrac-version $ rhcsMethod $ rhcsCipher $ rhcsUdpport $ rhcsSnmp-priv-passwd-script $ rhcsSnmp-priv-passwd $ rhcsSnmp-priv-prot $ rhcsSnmp-sec-level $ rhcsSnmp-auth-prot $ rhcsCommunity $ rhcsSnmp-version $ rhcsIdentity-file $ rhcsInet6-only $ rhcsInet4-only $ rhcsCmd-prompt $ rhcsHmc-version $ rhcsManaged $ rhcsPartition $ rhcsSeparator $ rhcsHelp $ rhcsVersion $ rhcsVerbose $ rhcsVmware-datacenter $ rhcsSecure $ rhcsVmware-type $ rhcsExec $ rhcsChannel-address $ rhcsSerial-params $ rhcsSerial-device $ rhcsTimeout $ rhcsUse-uuid $ rhcsDomain $ rhcsKey-file $ rhcsHash $ rhcsRetrans $ rhcsIpport $ rhcsMulticast-address $ rhcsIp-family $ rhcsDebug $ rhcsOption $ rhcsRpowerpath $ rhcsCserver $ rhcsServers $ rhcsAptpl $ rhcsLogfile $ rhcsAction $ rhcsDevices $ rhcsKey $ rhcsNodename $ rhcsLanplus $ rhcsAuth $ rhcsPasswd-script $ rhcsPasswd $ rhcsLogin $ rhcsIpaddr $ rhcsPort $ rhcsDevice )
)
objectClasses: (
1.3.6.1.4.1.2312.8.1.2.21 NAME 'rhcsRm' SUP top STRUCTURAL
@@ -1656,6 +1674,10 @@ objectClasses: (
# 1.3.6.1.4.1.2312.8.1.2.27 NAME 'rhcsResources' SUP top STRUCTURAL
# )
objectClasses: (
+ 1.3.6.1.4.1.2312.8.1.2.59 NAME 'rhcsClvmd' SUP top STRUCTURAL
+ MAY ( rhcsInterface )
+ )
+objectClasses: (
1.3.6.1.4.1.2312.8.1.2.31 NAME 'rhcsService' SUP top STRUCTURAL
MAY ( rhcs--enforce-timeouts $ rhcs--independent-subtree $ rhcsPriority $ rhcsRestart-expire-time $ rhcsMax-restarts $ rhcsDepend-mode $ rhcsDepend $ rhcsRecovery $ rhcsNfs-client-cache $ rhcsNfslock $ rhcsExclusive $ rhcsHardrecovery $ rhcsAutostart $ rhcsDomain $ name $ rhcsRef )
)
@@ -1770,5 +1792,5 @@ objectClasses: (
objectClasses: (
1.3.6.1.4.1.2312.8.1.2.6 NAME 'rhcsDevice' SUP top STRUCTURAL
MUST ( name )
- MAY ( rhcsRibcl $ rhcsSsl $ rhcsIo-fencing $ rhcsSwitch $ rhcsModule-name $ rhcsDrac-version $ rhcsMethod $ rhcsCipher $ rhcsTimeout $ rhcsUse-uuid $ rhcsDomain $ rhcsKey-file $ rhcsHash $ rhcsRetrans $ rhcsMulticast-ttl $ rhcsMulticast-address $ rhcsIp-family $ rhcsUdpport $ rhcsSnmp-priv-passwd-script $ rhcsSnmp-priv-passwd $ rhcsSnmp-priv-prot $ rhcsSnmp-sec-level $ rhcsSnmp-auth-prot $ rhcsCommunity $ rhcsSnmp-version $ rhcsIdentity-file $ rhcsIpport $ rhcsInet6-only $ rhcsInet4-only $ rhcsCmd-prompt $ rhcsHmc-version $ rhcsManaged $ rhcsPartition $ rhcsSeparator $ rhcsHelp $ rhcsVersion $ rhcsDebug $ rhcsVerbose $ rhcsVmware-datacenter $ rhcsSecure $ rhcsVmware-type $ rhcsExec $ rhcsOption $ rhcsRpowerpath $ rhcsCserver $ rhcsServers $ rhcsAptpl $ rhcsLogfile $ rhcsAction $ rhcsDevices $ rhcsKey $ rhcsNodename $ rhcsLanplus $ rhcsAuth $ rhcsPasswd-script $ rhcsPasswd $ rhcsLogin $ rhcsIpaddr $ rhcsPort $ rhcsDevice )
+ MAY ( rhcsRibcl $ rhcsSsl $ rhcsIo-fencing $ rhcsSwitch $ rhcsModule-name $ rhcsDrac-version $ rhcsMethod $ rhcsCipher $ rhcsUdpport $ rhcsSnmp-priv-passwd-script $ rhcsSnmp-priv-passwd $ rhcsSnmp-priv-prot $ rhcsSnmp-sec-level $ rhcsSnmp-auth-prot $ rhcsCommunity $ rhcsSnmp-version $ rhcsIdentity-file $ rhcsInet6-only $ rhcsInet4-only $ rhcsCmd-prompt $ rhcsHmc-version $ rhcsManaged $ rhcsPartition $ rhcsSeparator $ rhcsHelp $ rhcsVersion $ rhcsVerbose $ rhcsVmware-datacenter $ rhcsSecure $ rhcsVmware-type $ rhcsExec $ rhcsChannel-address $ rhcsSerial-params $ rhcsSerial-device $ rhcsTimeout $ rhcsUse-uuid $ rhcsDomain $ rhcsKey-file $ rhcsHash $ rhcsRetrans $ rhcsIpport $ rhcsMulticast-address $ rhcsIp-family $ rhcsDebug $ rhcsOption $ rhcsRpowerpath $ rhcsCserver $ rhcsServers $ rhcsAptpl $ rhcsLogfile $ rhcsAction $ rhcsDevices $ rhcsKey $ rhcsNodename $ rhcsLanplus $ rhcsAuth $ rhcsPasswd-script $ rhcsPasswd $ rhcsLogin $ rhcsIpaddr $ rhcsPort $ rhcsDevice )
)
diff --git a/config/plugins/ldap/ldap-base.csv b/config/plugins/ldap/ldap-base.csv
index 690b92f..14c8f06 100644
--- a/config/plugins/ldap/ldap-base.csv
+++ b/config/plugins/ldap/ldap-base.csv
@@ -1,5 +1,5 @@
-# Max attribute value: 269
-# Max object class value: 58
+# Max attribute value: 273
+# Max object class value: 59
obj,rhcsCluster,cluster,1
obj,rhcsCman,cman,3
obj,rhcsTotem,totem,4
@@ -326,3 +326,8 @@ attr,rhcsRibcl,ribcl,266
attr,rhcsKey,key,267
attr,rhcsDevices,devices,268
attr,rhcsAptpl,aptpl,269
+attr,rhcsSerial-device,serial_device,270
+attr,rhcsSerial-params,serial_params,271
+attr,rhcsChannel-address,channel_address,272
+obj,rhcsClvmd,clvmd,59
+attr,rhcsInterface,interface,273
14 years, 2 months
cluster: STABLE3 - config: Add fence_virt to cluster.rng
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: e8520c102e6e5fa6ffbb9614592cf9344a4be70f
Parent: 23adebdb29dcc8dc34d1508037434121c7a95ec7
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Feb 10 13:25:36 2010 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Wed Feb 10 13:28:54 2010 -0500
config: Add fence_virt to cluster.rng
Resolves: rhbz#561416
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
config/tools/xml/cluster.rng.in | 127 ++++++++++++++++++++++++--------------
1 files changed, 80 insertions(+), 47 deletions(-)
diff --git a/config/tools/xml/cluster.rng.in b/config/tools/xml/cluster.rng.in
index 36b4260..fd1eaf7 100644
--- a/config/tools/xml/cluster.rng.in
+++ b/config/tools/xml/cluster.rng.in
@@ -2144,6 +2144,86 @@ To validate your cluster.conf against this schema, run:
<group>
<attribute name="rpowerpath" rha:description="" rha:sample=""/>
</group>
+ <!-- fence_xvm ( provided by fence-virt package ) -->
+ <group>
+ <optional>
+ <attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
+ </optional>
+ <optional>
+ <attribute name="debug" rha:description="Specify (stdin) or increment (command line) debug level" />
+ </optional>
+ <optional>
+ <attribute name="ip_family" rha:description="IP Family ([auto], ipv4, ipv6)" />
+ </optional>
+ <optional>
+ <attribute name="multicast_address" rha:description="Multicast address (default=225.0.0.12 / ff05::3:1)" />
+ </optional>
+ <optional>
+ <attribute name="ipport" rha:description="Multicast or VMChannel IP port (default=1229)" />
+ </optional>
+ <optional>
+ <attribute name="retrans" rha:description="Multicast retransmit time (in 1/10sec; default=20)" />
+ </optional>
+ <optional>
+ <attribute name="auth" rha:description="Authentication (none, sha1, [sha256], sha512)" />
+ </optional>
+ <optional>
+ <attribute name="hash" rha:description="Packet hash strength (none, sha1, [sha256], sha512)" />
+ </optional>
+ <optional>
+ <attribute name="key_file" rha:description="Shared key file (default=/etc/cluster/fence_xvm.key)" />
+ </optional>
+ <optional>
+ <attribute name="port" rha:description="Virtual Machine (domain name) to fence" />
+ </optional>
+ <optional>
+ <attribute name="domain" rha:description="Virtual Machine (domain name) to fence (deprecated)" />
+ </optional>
+ <optional>
+ <attribute name="use_uuid" rha:description="Treat [domain] as UUID instead of domain name. This is provided for compatibility with older fence_xvmd installations." />
+ </optional>
+ <optional>
+ <attribute name="action" rha:description="Fencing action (null, off, on, [reboot], status, list, monitor, metadata)" />
+ </optional>
+ <optional>
+ <attribute name="timeout" rha:description="Fencing timeout (in seconds; default=30)" />
+ </optional>
+ </group>
+
+ <!-- fence_virt -->
+ <group>
+ <optional>
+ <attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
+ </optional>
+ <optional>
+ <attribute name="debug" rha:description="Specify (stdin) or increment (command line) debug level" />
+ </optional>
+ <optional>
+ <attribute name="serial_device" rha:description="Serial device (default=/dev/ttyS1)" />
+ </optional>
+ <optional>
+ <attribute name="serial_params" rha:description="Serial Parameters (default=115200,8N1)" />
+ </optional>
+ <optional>
+ <attribute name="channel_address" rha:description="VM Channel IP address (default=10.0.2.179)" />
+ </optional>
+ <optional>
+ <attribute name="ipport" rha:description="Multicast or VMChannel IP port (default=1229)" />
+ </optional>
+ <optional>
+ <attribute name="port" rha:description="Virtual Machine (domain name) to fence" />
+ </optional>
+ <optional>
+ <attribute name="domain" rha:description="Virtual Machine (domain name) to fence (deprecated)" />
+ </optional>
+ <optional>
+ <attribute name="action" rha:description="Fencing action (null, off, on, [reboot], status, list, monitor, metadata)" />
+ </optional>
+ <optional>
+ <attribute name="timeout" rha:description="Fencing timeout (in seconds; default=30)" />
+ </optional>
+ </group>
+
<!-- end non-generated device definitions -->
<!-- begin auto-generated device definitions -->
@@ -2563,53 +2643,6 @@ To validate your cluster.conf against this schema, run:
</group>
- <!-- fence_xvm -->
- <group>
- <optional>
- <attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
- </optional>
- <optional>
- <attribute name="debug" rha:description="Specify (CCS) / increment (command line) debug level" />
- </optional>
- <optional>
- <attribute name="ip_family" rha:description="IP Family ([auto], ipv4, ipv6)" />
- </optional>
- <optional>
- <attribute name="multicast_address" rha:description="Multicast address (default=225.0.0.12 / ff02::3:1)" />
- </optional>
- <optional>
- <attribute name="port" rha:description="IP port (default=1229)" />
- </optional>
- <optional>
- <attribute name="multicast_ttl" rha:description="Multicast time-to-live (in hops; default=2)" />
- </optional>
- <optional>
- <attribute name="retrans" rha:description="Multicast retransmit time (in 1/10sec; default=20)" />
- </optional>
- <optional>
- <attribute name="auth" rha:description="Authentication (none, sha1, [sha256], sha512)" />
- </optional>
- <optional>
- <attribute name="hash" rha:description="Packet hash strength (none, sha1, [sha256], sha512)" />
- </optional>
- <optional>
- <attribute name="key_file" rha:description="Shared key file (default=/etc/cluster/fence_xvm.key)" />
- </optional>
- <optional>
- <attribute name="domain" rha:description="Virtual machine (domain name) to fence" />
- </optional>
- <optional>
- <attribute name="use_uuid" rha:description="Treat 'domain' as UUID instead of domain name" />
- </optional>
- <optional>
- <attribute name="action" rha:description="Fencing action (null, off, [reboot])" />
- </optional>
- <optional>
- <attribute name="timeout" rha:description="Fencing timeout (in seconds; default=30)" />
- </optional>
- </group>
-
-
<!-- fence_ipmilan -->
<group>
<optional>
14 years, 2 months
cluster: STABLE3 - rgmanager: isAlive error logging for file systems
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 23adebdb29dcc8dc34d1508037434121c7a95ec7
Parent: b5a948214b9573970122c8c4fc07acfb56f049fc
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Feb 10 12:11:33 2010 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Wed Feb 10 12:11:33 2010 -0500
rgmanager: isAlive error logging for file systems
This change adapts two different patch sets, one
contributed by Nick Downs.
It fixes:
- isAlive logging for all file systems
- file naming during isAlive checks for cluster
file systems
Resolves: rhbz#562237
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/clusterfs.sh | 15 +++++++++++----
rgmanager/src/resources/fs.sh.in | 13 ++++++++++---
2 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/rgmanager/src/resources/clusterfs.sh b/rgmanager/src/resources/clusterfs.sh
index 8558d5f..0ccc93d 100644
--- a/rgmanager/src/resources/clusterfs.sh
+++ b/rgmanager/src/resources/clusterfs.sh
@@ -424,8 +424,9 @@ Device $dev is mounted on $tmp_mp instead of $mp"
#
isAlive()
{
+ declare errcode
declare mount_point
- declare file=".writable_test"
+ declare file=".writable_test.$(hostname)"
declare rw
if [ $# -ne 1 ]; then
@@ -444,8 +445,10 @@ isAlive()
# depth 10 test (read test)
ls $mount_point > /dev/null 2> /dev/null
- if [ $? -ne 0 ]; then
- return $NO
+ errcode=$?
+ if [ $errcode -ne 0 ]; then
+ ocf_log err "clusterfs:${OCF_RESKEY_name}: isAlive failed read test on [$mount_point]. Return code: $errcode"
+ return $NO
fi
[ $OCF_CHECK_LEVEL -lt 20 ] && return $YES
@@ -468,7 +471,11 @@ isAlive()
fi
done
touch $file > /dev/null 2> /dev/null
- [ $? -ne 0 ] && return $NO
+ errcode=$?
+ if [ $errcode -ne 0 ]; then
+ ocf_log err "clusterfs:${OCF_RESKEY_name}: isAlive failed write test on [$mount_point]. Return code: $errcode"
+ return $NO
+ fi
rm -f $file > /dev/null 2> /dev/null
fi
diff --git a/rgmanager/src/resources/fs.sh.in b/rgmanager/src/resources/fs.sh.in
index 65cff9c..1454295 100644
--- a/rgmanager/src/resources/fs.sh.in
+++ b/rgmanager/src/resources/fs.sh.in
@@ -620,6 +620,7 @@ isMounted () {
#
isAlive()
{
+ declare errcode
declare mount_point
declare file=".writable_test"
declare rw
@@ -640,8 +641,10 @@ isAlive()
# depth 10 test (read test)
ls $mount_point > /dev/null 2> /dev/null
- if [ $? -ne 0 ]; then
- return $NO
+ errcode=$?
+ if [ $errcode -ne 0 ]; then
+ ocf_log err "fs:${OCF_RESKEY_name}: isAlive failed read test on [$mount_point]. Return code: $errcode"
+ return $NO
fi
[ $OCF_CHECK_LEVEL -lt 20 ] && return $YES
@@ -664,7 +667,11 @@ isAlive()
fi
done
touch $file > /dev/null 2> /dev/null
- [ $? -ne 0 ] && return $NO
+ errcode=$?
+ if [ $errcode -ne 0 ]; then
+ ocf_log err "fs:${OCF_RESKEY_name}: isAlive failed write test on [$mount_point]. Return code: $errcode"
+ return $NO
+ fi
rm -f $file > /dev/null 2> /dev/null
fi
14 years, 2 months
cluster: RHEL55 - rgmanager: isAlive error logging for file systems
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: c35975aa2c0819482e29ca6e391f5a9f15dbcea9
Parent: dcfffdf4e2ebebae62958673e53138982fb3af97
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Feb 10 12:11:33 2010 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Wed Feb 10 14:02:06 2010 -0500
rgmanager: isAlive error logging for file systems
This change adapts two different patch sets, one
contributed by Nick Downs.
It fixes:
- isAlive logging for all file systems
- file naming during isAlive checks for cluster
file systems
Resolves: rhbz#562237
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/clusterfs.sh | 15 +++++++++++----
rgmanager/src/resources/fs.sh | 13 ++++++++++---
2 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/rgmanager/src/resources/clusterfs.sh b/rgmanager/src/resources/clusterfs.sh
index 0e18f28..250978e 100755
--- a/rgmanager/src/resources/clusterfs.sh
+++ b/rgmanager/src/resources/clusterfs.sh
@@ -444,8 +444,9 @@ Device $dev is mounted on $tmp_mp instead of $mp"
#
isAlive()
{
+ declare errcode
declare mount_point
- declare file=".writable_test"
+ declare file=".writable_test.$(hostname)"
declare rw
if [ $# -ne 1 ]; then
@@ -464,8 +465,10 @@ isAlive()
# depth 10 test (read test)
ls $mount_point > /dev/null 2> /dev/null
- if [ $? -ne 0 ]; then
- return $NO
+ errcode=$?
+ if [ $errcode -ne 0 ]; then
+ ocf_log err "clusterfs:${OCF_RESKEY_name}: isAlive failed read test on [$mount_point]. Return code: $errcode"
+ return $NO
fi
[ $OCF_CHECK_LEVEL -lt 20 ] && return $YES
@@ -488,7 +491,11 @@ isAlive()
fi
done
touch $file > /dev/null 2> /dev/null
- [ $? -ne 0 ] && return $NO
+ errcode=$?
+ if [ $errcode -ne 0 ]; then
+ ocf_log err "clusterfs:${OCF_RESKEY_name}: isAlive failed write test on [$mount_point]. Return code: $errcode"
+ return $NO
+ fi
rm -f $file > /dev/null 2> /dev/null
fi
diff --git a/rgmanager/src/resources/fs.sh b/rgmanager/src/resources/fs.sh
index 03cd59a..8214079 100755
--- a/rgmanager/src/resources/fs.sh
+++ b/rgmanager/src/resources/fs.sh
@@ -635,6 +635,7 @@ isMounted () {
#
isAlive()
{
+ declare errcode
declare mount_point
declare file=".writable_test"
declare rw
@@ -655,8 +656,10 @@ isAlive()
# depth 10 test (read test)
ls $mount_point > /dev/null 2> /dev/null
- if [ $? -ne 0 ]; then
- return $NO
+ errcode=$?
+ if [ $errcode -ne 0 ]; then
+ ocf_log err "fs:${OCF_RESKEY_name}: isAlive failed read test on [$mount_point]. Return code: $errcode"
+ return $NO
fi
[ $OCF_CHECK_LEVEL -lt 20 ] && return $YES
@@ -679,7 +682,11 @@ isAlive()
fi
done
touch $file > /dev/null 2> /dev/null
- [ $? -ne 0 ] && return $NO
+ errcode=$?
+ if [ $errcode -ne 0 ]; then
+ ocf_log err "fs:${OCF_RESKEY_name}: isAlive failed write test on [$mount_point]. Return code: $errcode"
+ return $NO
+ fi
rm -f $file > /dev/null 2> /dev/null
fi
14 years, 2 months
cluster: RHEL55 - cman/groupd/dlm_controld/gfs_controld: work around ipc deadlock
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: dcfffdf4e2ebebae62958673e53138982fb3af97
Parent: 5239e25bfd9967a08427bcbcc15548731dad34f1
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Feb 8 15:26:03 2010 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Feb 9 13:40:10 2010 -0600
cman/groupd/dlm_controld/gfs_controld: work around ipc deadlock
bz 561892
When there are many gfs fs's (approx above 120) in a two
node cluster, and one of the nodes fails, groupd on the
remaining node can deadlock with dlm_controld and gfs_controld.
The problem is caused by so much communication (lots of fs's)
being sent between groupd and the other daemons so quickly
(no other nodes to synchronize with), that the unix socket
buffers fill up, causing both daemons to be blocked writing
stop/start/stop_done/start_done messages to the other.
Since the daemons are single threaded, being blocked on write
means that neither will read to unblock the other.
To determine if you're having this problem, you can strace
groupd, dlm_controld and gfs_controld, and notice that they
are blocked writing strings starting with "stop" or "start".
group_tool will hang since groupd is blocked.
The solution has three main parts:
1. dlm_controld queues its stop_done and start_done messages
and waits to send them to groupd until groupd is finished
sending all the stop/start messages.
2. gfs_controld does the same only for stop_done messages
(start_done messages are already naturally delayed here)
3. groupd skips sending finish messages to dlm_controld,
since dlm_controld does not use them for anything
Each of these changes in behavior are disabled by default and
need to be configured explicitly:
1. <dlm delay_done="2"/> in cluster.conf
2. <gfs_controld delay_done="2"/> in cluster.conf
3. SKIP_DLM_FINISH=1 in /etc/sysconfig/cman
(adds -f0 option to groupd which doesn't read
options from cluster.conf)
The delay_done values are in seconds. If the same problem
persists with these settings, values of 4 or 8 might help.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
cman/init.d/cman | 20 +++++-
group/daemon/main.c | 14 ++++-
group/dlm_controld/action.c | 38 ++++++++++
group/dlm_controld/deadlock.c | 1 -
group/dlm_controld/dlm_daemon.h | 12 +++
group/dlm_controld/group.c | 138 +++++++++++++++++++++++++++++++++++---
group/dlm_controld/main.c | 75 +++++++++++++++++++-
group/dlm_controld/member_cman.c | 1 -
group/gfs_controld/group.c | 55 +++++++++++++++
group/gfs_controld/lock_dlm.h | 10 +++
group/gfs_controld/main.c | 60 ++++++++++++++++-
group/gfs_controld/recover.c | 6 ++-
12 files changed, 408 insertions(+), 22 deletions(-)
diff --git a/cman/init.d/cman b/cman/init.d/cman
index f717e8b..78cc6ce 100755
--- a/cman/init.d/cman
+++ b/cman/init.d/cman
@@ -31,6 +31,11 @@
# The default is 60 seconds
[ -z "$CMAN_SHUTDOWN_TIMEOUT" ] && CMAN_SHUTDOWN_TIMEOUT=60
+# SKIP_DLM_FINISH -- setting to 1 will cause groupd to be started with
+# -f0, which causes groupd to not send finish callbacks to dlm_controld
+# as part of a workaround for bz 561892.
+[ -z "$SKIP_DLM_FINISH" ] && SKIP_DLM_FINISH=0
+
# FENCED_START_TIMEOUT -- amount of time to wait for starting fenced
# before giving up. If FENCED_START_TIMEOUT is positive, then we will
# wait FENCED_START_TIMEOUT seconds before giving up and failing when
@@ -61,6 +66,7 @@
[ -n "$NODENAME" ] && cman_join_opts+=" -n $NODENAME"
+
load_modules()
{
errmsg=$( /sbin/modprobe configfs 2>&1 ) || return 1
@@ -145,21 +151,31 @@ start_qdiskd()
start_daemons()
{
status groupd &> /dev/null
- if [ $? -ne 0 ]; then
- errmsg=$( /sbin/groupd 2>&1 ) || return 1
+ if [ $? -ne 0 ]
+ then
+ if [ $SKIP_DLM_FINISH -eq 1 ]
+ then
+ errmsg=$( /sbin/groupd -f0 2>&1 ) || return 1
+ else
+ errmsg=$( /sbin/groupd 2>&1 ) || return 1
+ fi
fi
+
status fenced &> /dev/null
if [ $? -ne 0 ]; then
errmsg=$( /sbin/fenced 2>&1 ) || return 1
fi
+
status dlm_controld &> /dev/null
if [ $? -ne 0 ]; then
errmsg=$( /sbin/dlm_controld 2>&1 ) || return 1
fi
+
status gfs_controld &> /dev/null
if [ $? -ne 0 ]; then
errmsg=$( /sbin/gfs_controld 2>&1 ) || return 1
fi
+
return 0
}
diff --git a/group/daemon/main.c b/group/daemon/main.c
index f5dcc88..7a4fca4 100644
--- a/group/daemon/main.c
+++ b/group/daemon/main.c
@@ -15,7 +15,7 @@
#include "gd_internal.h"
-#define OPTION_STRING "Dhs:Vv"
+#define OPTION_STRING "Dhs:f:Vv"
#define LOCKFILE_NAME "/var/run/groupd.pid"
#define LOG_FILE "/var/log/groupd.log"
@@ -27,6 +27,7 @@ uint32_t gd_event_nr;
char *our_name;
int our_nodeid;
int cman_quorate;
+int dlm_finish = 1;
static int client_maxi;
static int client_size = 0;
@@ -314,6 +315,12 @@ void app_start(app_t *a)
void app_finish(app_t *a)
{
char buf[GROUPD_MSGLEN];
+
+ if (!strncmp(client[a->client].type, "dlm", 3) && !dlm_finish) {
+ log_group(a->g, "skip finish");
+ return;
+ }
+
snprintf(buf, sizeof(buf), "finish %s %d",
a->g->name, a->current_event->event_nr);
app_action(a, buf);
@@ -919,6 +926,7 @@ static void print_usage(void)
printf(" -D Enable debugging code and don't fork\n");
printf(" -h Print this help, then exit\n");
printf(" -s [0|1] Enable (or disable) shutdown mode\n");
+ printf(" -f [0|1] Send finish callbacks to dlm_controld, default 1\n");
printf(" -V Print program version information, then exit\n");
}
@@ -945,6 +953,10 @@ static void decode_arguments(int argc, char **argv)
groupd_shutdown_opt = atoi(optarg);
break;
+ case 'f':
+ dlm_finish = atoi(optarg);
+ break;
+
case 'v':
groupd_debug_verbose++;
break;
diff --git a/group/dlm_controld/action.c b/group/dlm_controld/action.c
index 34e84fe..a7ea3a7 100644
--- a/group/dlm_controld/action.c
+++ b/group/dlm_controld/action.c
@@ -968,6 +968,43 @@ static void set_debug(int cd)
set_configfs_debug(rv);
}
+#define DELAY_DONE_PATH "/cluster/dlm/@delay_done"
+
+static int get_ccs_delay_done(int cd)
+{
+ char path[PATH_MAX], *str;
+ int error, rv;
+
+ memset(path, 0, PATH_MAX);
+ sprintf(path, DELAY_DONE_PATH);
+
+ error = ccs_get(cd, path, &str);
+ if (error || !str)
+ return -1;
+
+ rv = atoi(str);
+
+ if (rv < 0) {
+ log_error("invalid delay_done from ccs");
+ rv = -1;
+ }
+
+ free(str);
+ log_error("ccs dlm/delay_done %d", rv);
+ return rv;
+}
+
+static void set_delay_done(int cd)
+{
+ int rv;
+
+ rv = get_ccs_delay_done(cd);
+ if (rv < 0)
+ return;
+
+ delay_done_cb = rv;
+}
+
void set_ccs_options(void)
{
int cd;
@@ -979,6 +1016,7 @@ void set_ccs_options(void)
set_protocol(cd);
set_timewarn(cd);
set_debug(cd);
+ set_delay_done(cd);
ccs_disconnect(cd);
}
diff --git a/group/dlm_controld/deadlock.c b/group/dlm_controld/deadlock.c
index f21beda..0b1538a 100644
--- a/group/dlm_controld/deadlock.c
+++ b/group/dlm_controld/deadlock.c
@@ -15,7 +15,6 @@
int deadlock_enabled = 0;
-extern struct list_head lockspaces;
extern int our_nodeid;
static SaCkptHandleT global_ckpt_h;
diff --git a/group/dlm_controld/dlm_daemon.h b/group/dlm_controld/dlm_daemon.h
index c164a81..0037d32 100644
--- a/group/dlm_controld/dlm_daemon.h
+++ b/group/dlm_controld/dlm_daemon.h
@@ -63,6 +63,16 @@ extern int daemon_debug_opt;
extern int kernel_debug_opt;
extern char daemon_debug_buf[256];
+extern int delay_done_cb;
+extern struct list_head stop_done_list;
+extern int stop_done_entries;
+extern struct list_head start_done_list;
+extern int start_done_entries;
+extern struct list_head lockspaces;
+extern int lockspace_count;
+extern uint64_t last_stop_time;
+extern uint64_t last_start_time;
+
#define log_debug(fmt, args...) \
do { \
snprintf(daemon_debug_buf, 255, "%ld " fmt "\n", time(NULL), ##args); \
@@ -123,6 +133,8 @@ char *nodeid2name(int nodeid);
/* group.c */
int setup_groupd(void);
void process_groupd(int ci);
+void push_stop_done(void);
+void push_start_done(void);
/* main.c */
int client_add(int fd, void (*workfn)(int ci), void (*deadfn)(int ci));
diff --git a/group/dlm_controld/group.c b/group/dlm_controld/group.c
index 700edac..3024bef 100644
--- a/group/dlm_controld/group.c
+++ b/group/dlm_controld/group.c
@@ -24,6 +24,7 @@
do the processing within the callback function itself */
group_handle_t gh;
+
static int cb_action;
static char cb_name[MAX_GROUP_NAME_LEN+1];
static int cb_event_nr;
@@ -31,6 +32,7 @@ static unsigned int cb_id;
static int cb_type;
static int cb_member_count;
static int cb_members[MAX_GROUP_MEMBERS];
+static int last_action;
static void stop_cbfn(group_handle_t h, void *private, char *name)
{
@@ -116,10 +118,108 @@ static unsigned int replace_zero_global_id(char *name)
return new_id;
}
+struct save_done {
+ struct list_head list;
+ int event_nr;
+ char name[MAX_GROUP_NAME_LEN+1];
+};
+
+void push_stop_done(void)
+{
+ struct save_done *sd, *safe;
+ int count;
+
+ if (stop_done_entries > 1)
+ log_error("push_stop_done begin %d", stop_done_entries);
+
+ count = 0;
+
+ list_for_each_entry_safe(sd, safe, &stop_done_list, list) {
+ group_stop_done(gh, sd->name);
+ list_del(&sd->list);
+ free(sd);
+ stop_done_entries--;
+ count++;
+ }
+
+ if (count > 1)
+ log_error("push_stop_done end %d", count);
+}
+
+/* only queue if the last action is also stop? */
+
+static int queue_stop_done(char *name)
+{
+ struct save_done *sd;
+
+ if (!delay_done_cb)
+ return -1;
+
+ if (last_action != DO_STOP)
+ return -1;
+
+ sd = malloc(sizeof(struct save_done));
+ if (!sd)
+ return -1;
+
+ memset(sd, 0, sizeof(struct save_done));
+ strcpy(sd->name, name);
+ list_add_tail(&sd->list, &stop_done_list);
+ stop_done_entries++;
+
+ return 0;
+}
+
+void push_start_done(void)
+{
+ struct save_done *sd, *safe;
+ int count;
+
+ if (start_done_entries > 1)
+ log_error("push_start_done begin %d", start_done_entries);
+
+ count = 0;
+
+ list_for_each_entry_safe(sd, safe, &start_done_list, list) {
+ group_start_done(gh, sd->name, sd->event_nr);
+ list_del(&sd->list);
+ free(sd);
+ start_done_entries--;
+ count++;
+ }
+
+ if (count > 1)
+ log_error("push_start_done end %d", count);
+}
+
+static int queue_start_done(char *name, int event_nr)
+{
+ struct save_done *sd;
+
+ if (!delay_done_cb)
+ return -1;
+
+ if (last_action != DO_START)
+ return -1;
+
+ sd = malloc(sizeof(struct save_done));
+ if (!sd)
+ return -1;
+
+ memset(sd, 0, sizeof(struct save_done));
+ strcpy(sd->name, name);
+ sd->event_nr = event_nr;
+ list_add_tail(&sd->list, &start_done_list);
+ start_done_entries++;
+
+ return 0;
+}
+
void process_groupd(int ci)
{
struct lockspace *ls;
int error = 0, val;
+ int rv;
group_dispatch(gh);
@@ -137,7 +237,10 @@ void process_groupd(int ci)
case DO_STOP:
log_debug("groupd callback: stop %s", cb_name);
set_control(cb_name, 0);
- group_stop_done(gh, cb_name);
+ rv = queue_stop_done(cb_name);
+ if (rv < 0)
+ group_stop_done(gh, cb_name);
+ last_stop_time = time(NULL);
break;
case DO_START:
@@ -154,20 +257,27 @@ void process_groupd(int ci)
/* the dlm doesn't need/use a "finish" stage following
start, so we can just do start_done immediately */
- group_start_done(gh, cb_name, cb_event_nr);
- if (!ls->joining)
+ if (!ls->joining) {
+ rv = queue_start_done(cb_name, cb_event_nr);
+ if (rv < 0)
+ group_start_done(gh, cb_name, cb_event_nr);
+ last_start_time = time(NULL);
break;
+ } else {
+ group_start_done(gh, cb_name, cb_event_nr);
- ls->joining = 0;
- log_debug("join event done %s", cb_name);
+ ls->joining = 0;
+ log_debug("join event done %s", cb_name);
- /* this causes the dlm_new_lockspace() call (typically from
- mount) to complete */
- set_event_done(cb_name, 0);
+ /* this causes the dlm_new_lockspace() call (typically from
+ mount) to complete */
+ set_event_done(cb_name, 0);
- join_deadlock_cpg(ls);
- break;
+ join_deadlock_cpg(ls);
+ last_start_time = time(NULL);
+ break;
+ }
case DO_SETID:
log_debug("groupd callback: set_id %s %x", cb_name, cb_id);
@@ -195,6 +305,7 @@ void process_groupd(int ci)
set_event_done(cb_name, val);
leave_deadlock_cpg(ls);
list_del(&ls->list);
+ lockspace_count--;
free(ls);
break;
@@ -206,6 +317,8 @@ void process_groupd(int ci)
error = -EINVAL;
}
+ last_action = cb_action;
+
cb_action = 0;
out:
return;
@@ -215,6 +328,11 @@ int setup_groupd(void)
{
int rv;
+ INIT_LIST_HEAD(&stop_done_list);
+ INIT_LIST_HEAD(&start_done_list);
+ stop_done_entries = 0;
+ start_done_entries = 0;
+
gh = group_init(NULL, "dlm", 1, &callbacks, GROUPD_TIMEOUT);
if (!gh) {
log_error("group_init error %p %d", gh, errno);
diff --git a/group/dlm_controld/main.c b/group/dlm_controld/main.c
index 1588605..d47ea63 100644
--- a/group/dlm_controld/main.c
+++ b/group/dlm_controld/main.c
@@ -17,15 +17,13 @@
#include <linux/dlm.h>
#include <linux/dlm_netlink.h>
-#define OPTION_STRING "KDhVd:"
+#define OPTION_STRING "KDhVd:y:"
#define LOCKFILE_NAME "/var/run/dlm_controld.pid"
#define DEADLOCK_CHECK_SECS 10
#define NALLOC 16
-struct list_head lockspaces;
-
extern group_handle_t gh;
extern int deadlock_enabled;
@@ -265,6 +263,7 @@ static void process_uevent(int ci)
ls->joining = 1;
list_add(&ls->list, &lockspaces);
+ lockspace_count++;
rv = group_join(gh, argv[3]);
@@ -611,8 +610,11 @@ void cluster_dead(int ci)
static int loop(void)
{
int rv, i;
+ int poll_timeout = -1;
void (*workfn) (int ci);
void (*deadfn) (int ci);
+ uint64_t push_begin = 0;
+ uint64_t now;
rv = setup_listener();
if (rv < 0)
@@ -646,7 +648,7 @@ static int loop(void)
for_loop:
for (;;) {
- rv = poll(pollfd, client_maxi + 1, -1);
+ rv = poll(pollfd, client_maxi + 1, poll_timeout);
if (rv == -1 && errno == EINTR) {
if (daemon_quit && list_empty(&lockspaces)) {
clear_configfs();
@@ -672,6 +674,56 @@ static int loop(void)
deadfn(i);
}
}
+
+ if (delay_done_cb && !list_empty(&stop_done_list)) {
+ if (!push_begin) {
+ push_begin = time(NULL);
+ poll_timeout = 1000;
+ }
+ now = time(NULL);
+
+ if ((stop_done_entries == lockspace_count) ||
+ (now - push_begin >= delay_done_cb)) {
+ if (stop_done_entries > 1) {
+ log_error("stop_done entries %d "
+ "count %d begin %llu "
+ "now %llu last stop %llu",
+ stop_done_entries,
+ lockspace_count,
+ (unsigned long long)push_begin,
+ (unsigned long long)now,
+ (unsigned long long)last_stop_time);
+ }
+ push_stop_done();
+ push_begin = 0;
+ poll_timeout = -1;
+ }
+ }
+
+ if (delay_done_cb && !list_empty(&start_done_list)) {
+ if (!push_begin) {
+ push_begin = time(NULL);
+ poll_timeout = 1000;
+ }
+ now = time(NULL);
+
+ if ((start_done_entries == lockspace_count) ||
+ (now - push_begin >= delay_done_cb)) {
+ if (start_done_entries > 1) {
+ log_error("start_done entries %d "
+ "count %d begin %llu "
+ "now %llu last start %llu",
+ start_done_entries,
+ lockspace_count,
+ (unsigned long long)push_begin,
+ (unsigned long long)now,
+ (unsigned long long)last_start_time);
+ }
+ push_start_done();
+ push_begin = 0;
+ poll_timeout = -1;
+ }
+ }
}
rv = 0;
out:
@@ -754,6 +806,7 @@ static void print_usage(void)
#endif
printf(" -D Enable debugging code and don't fork\n");
printf(" -K Enable kernel dlm debugging messages\n");
+ printf(" -y <sec> Delay done callbacks to groupd by this many seconds, default 0\n");
printf(" -h Print this help, then exit\n");
printf(" -V Print program version information, then exit\n");
}
@@ -780,6 +833,10 @@ static void decode_arguments(int argc, char **argv)
print_usage();
exit(EXIT_SUCCESS);
break;
+
+ case 'y':
+ delay_done_cb = atoi(optarg);
+ break;
#if DEADLOCK
case 'd':
deadlock_enabled = atoi(optarg);
@@ -844,6 +901,7 @@ int main(int argc, char **argv)
prog_name = argv[0];
INIT_LIST_HEAD(&lockspaces);
+ lockspace_count = 0;
decode_arguments(argc, argv);
@@ -871,4 +929,13 @@ char *prog_name;
int daemon_debug_opt;
char daemon_debug_buf[256];
int kernel_debug_opt;
+int delay_done_cb = 0;
+struct list_head stop_done_list;
+int stop_done_entries;
+struct list_head start_done_list;
+int start_done_entries;
+struct list_head lockspaces;
+int lockspace_count;
+uint64_t last_stop_time;
+uint64_t last_start_time;
diff --git a/group/dlm_controld/member_cman.c b/group/dlm_controld/member_cman.c
index 1ce180c..b37e4ec 100644
--- a/group/dlm_controld/member_cman.c
+++ b/group/dlm_controld/member_cman.c
@@ -19,7 +19,6 @@ static cman_node_t old_nodes[MAX_NODES];
static int old_node_count;
static cman_node_t cman_nodes[MAX_NODES];
static int cman_node_count;
-extern struct list_head lockspaces;
static int is_member(cman_node_t *node_list, int count, int nodeid)
{
diff --git a/group/gfs_controld/group.c b/group/gfs_controld/group.c
index 3717579..d2fff7c 100644
--- a/group/gfs_controld/group.c
+++ b/group/gfs_controld/group.c
@@ -23,6 +23,7 @@ static unsigned int cb_id;
static int cb_type;
static int cb_member_count;
static int cb_members[MAX_GROUP_MEMBERS];
+static int last_action;
int do_stop(struct mountgroup *mg);
int do_finish(struct mountgroup *mg);
@@ -109,6 +110,55 @@ static unsigned int replace_zero_global_id(char *name)
return new_id;
}
+struct save_done {
+ struct list_head list;
+ char name[MAX_GROUP_NAME_LEN+1];
+};
+
+void push_stop_done(void)
+{
+ struct save_done *sd, *safe;
+ int count;
+
+ if (stop_done_entries > 1)
+ log_error("push_stop_done begin %d", stop_done_entries);
+
+ count = 0;
+
+ list_for_each_entry_safe(sd, safe, &stop_done_list, list) {
+ group_stop_done(gh, sd->name);
+ list_del(&sd->list);
+ free(sd);
+ stop_done_entries--;
+ count++;
+ }
+
+ if (count > 1)
+ log_error("push_stop_done end %d", count);
+}
+
+int queue_stop_done(char *name)
+{
+ struct save_done *sd;
+
+ if (!delay_done_cb)
+ return -1;
+
+ if (last_action != DO_STOP)
+ return -1;
+
+ sd = malloc(sizeof(struct save_done));
+ if (!sd)
+ return -1;
+
+ memset(sd, 0, sizeof(struct save_done));
+ strcpy(sd->name, name);
+ list_add_tail(&sd->list, &stop_done_list);
+ stop_done_entries++;
+
+ return 0;
+}
+
int process_groupd(void)
{
struct mountgroup *mg;
@@ -132,6 +182,7 @@ int process_groupd(void)
switch (cb_action) {
case DO_STOP:
+ last_stop_time = time(NULL);
log_debug("groupd cb: stop %s", cb_name);
mg->last_callback = DO_STOP;
mg->last_stop = mg->last_start;
@@ -170,6 +221,7 @@ int process_groupd(void)
error = -EINVAL;
}
+ last_action = cb_action;
out:
cb_action = 0;
return error;
@@ -179,6 +231,9 @@ int setup_groupd(void)
{
int rv;
+ INIT_LIST_HEAD(&stop_done_list);
+ stop_done_entries = 0;
+
gh = group_init(NULL, LOCK_DLM_GROUP_NAME, LOCK_DLM_GROUP_LEVEL,
&callbacks, 10);
if (!gh) {
diff --git a/group/gfs_controld/lock_dlm.h b/group/gfs_controld/lock_dlm.h
index 746d0c7..cc12e1c 100644
--- a/group/gfs_controld/lock_dlm.h
+++ b/group/gfs_controld/lock_dlm.h
@@ -74,6 +74,13 @@ extern char dump_buf[DUMP_SIZE];
extern int dump_point;
extern int dump_wrap;
+extern int delay_done_cb;
+extern struct list_head stop_done_list;
+extern int stop_done_entries;
+extern struct list_head mounts;
+extern int mountgroup_count;
+extern uint64_t last_stop_time;
+
extern void daemon_dump_save(void);
#define log_debug(fmt, args...) \
@@ -283,6 +290,9 @@ int setup_plocks(void);
int process_plocks(void);
void exit_cman(void);
+void push_stop_done(void);
+int queue_stop_done(char *name);
+
int do_mount(int ci, char *dir, char *type, char *proto, char *table,
char *options, char *dev, struct mountgroup **mg_ret);
int do_unmount(int ci, char *dir, int mnterr);
diff --git a/group/gfs_controld/main.c b/group/gfs_controld/main.c
index 7293938..5a70f60 100644
--- a/group/gfs_controld/main.c
+++ b/group/gfs_controld/main.c
@@ -41,7 +41,6 @@ struct client {
int another_mount;
};
-extern struct list_head mounts;
extern struct list_head withdrawn_mounts;
extern group_handle_t gh;
@@ -545,6 +544,8 @@ int setup_uevent(void)
int loop(void)
{
int rv, i, f, error, poll_timeout = -1, ignore_plocks_fd = 0;
+ uint64_t push_begin = 0;
+ uint64_t now;
rv = listen_fd = setup_listen();
if (rv < 0)
@@ -655,6 +656,31 @@ int loop(void)
}
}
}
+
+ if (delay_done_cb && !list_empty(&stop_done_list)) {
+ if (!push_begin) {
+ push_begin = time(NULL);
+ poll_timeout = 1000;
+ }
+ now = time(NULL);
+
+ if ((stop_done_entries == mountgroup_count) ||
+ (now - push_begin >= delay_done_cb)) {
+ if (stop_done_entries > 1) {
+ log_error("stop_done entries %d "
+ "count %d begin %llu "
+ "now %llu last stop %llu",
+ stop_done_entries,
+ mountgroup_count,
+ (unsigned long long)push_begin,
+ (unsigned long long)now,
+ (unsigned long long)last_stop_time);
+ }
+ push_stop_done();
+ push_begin = 0;
+ poll_timeout = -1;
+ }
+ }
}
rv = 0;
out:
@@ -666,11 +692,12 @@ int loop(void)
#define DROP_RESOURCES_TIME_PATH "/cluster/gfs_controld/@drop_resources_time"
#define DROP_RESOURCES_COUNT_PATH "/cluster/gfs_controld/@drop_resources_count"
#define DROP_RESOURCES_AGE_PATH "/cluster/gfs_controld/@drop_resources_age"
+#define DELAY_DONE_PATH "/cluster/gfs_controld/@delay_done"
static void set_ccs_config(void)
{
char path[PATH_MAX], *str;
- int i = 0, cd, error;
+ int i = 0, cd, error, rv;
while ((cd = ccs_connect()) < 0) {
sleep(1);
@@ -738,6 +765,23 @@ static void set_ccs_config(void)
}
if (str)
free(str);
+
+ memset(path, 0, PATH_MAX);
+ snprintf(path, PATH_MAX, "%s", DELAY_DONE_PATH);
+ str = NULL;
+
+ error = ccs_get(cd, path, &str);
+ if (!error) {
+ rv = atoi(str);
+ if (rv < 0) {
+ log_error("invalid delay_done from ccs");
+ } else {
+ delay_done_cb = rv;
+ log_error("ccs gfs_controld/delay_done %d", rv);
+ }
+ }
+ if (str)
+ free(str);
}
static void lockfile(void)
@@ -824,6 +868,7 @@ static void print_usage(void)
printf(" Default is %u\n", DEFAULT_DROP_RESOURCES_COUNT);
printf(" -a <ms> drop resources age (milliseconds)\n");
printf(" Default is %u\n", DEFAULT_DROP_RESOURCES_AGE);
+ printf(" -y <sec> Delay done callbacks to groupd by this many seconds, default 0\n");
printf(" -h Print this help, then exit\n");
printf(" -V Print program version information, then exit\n");
}
@@ -881,6 +926,10 @@ static void decode_arguments(int argc, char **argv)
opt_drop_resources_age = 1;
break;
+ case 'y':
+ delay_done_cb = atoi(optarg);
+ break;
+
case 'h':
print_usage();
exit(EXIT_SUCCESS);
@@ -946,6 +995,7 @@ int main(int argc, char **argv)
INIT_LIST_HEAD(&mounts);
INIT_LIST_HEAD(&withdrawn_mounts);
+ mountgroup_count = 0;
config_no_withdraw = DEFAULT_NO_WITHDRAW;
config_no_plock = DEFAULT_NO_PLOCK;
@@ -1007,4 +1057,10 @@ char daemon_debug_buf[256];
char dump_buf[DUMP_SIZE];
int dump_point;
int dump_wrap;
+int delay_done_cb = 0;
+struct list_head stop_done_list;
+int stop_done_entries;
+struct list_head mounts;
+int mountgroup_count;
+uint64_t last_stop_time;
diff --git a/group/gfs_controld/recover.c b/group/gfs_controld/recover.c
index 52d96ff..3eec64f 100644
--- a/group/gfs_controld/recover.c
+++ b/group/gfs_controld/recover.c
@@ -1676,6 +1676,7 @@ int do_mount(int ci, char *dir, char *type, char *proto, char *table,
}
list_add(&mg->list, &mounts);
+ mountgroup_count++;
group_join(gh, name);
rv = 0;
out:
@@ -1996,6 +1997,7 @@ int do_unmount(int ci, char *dir, int mnterr)
free(mp);
if (list_empty(&mg->mountpoints)) {
list_del(&mg->list);
+ mountgroup_count--;
free(mg);
}
return 0;
@@ -2342,7 +2344,9 @@ int do_stop(struct mountgroup *mg)
}
}
out:
- group_stop_done(gh, mg->name);
+ rv = queue_stop_done(mg->name);
+ if (rv < 0)
+ group_stop_done(gh, mg->name);
return 0;
}
14 years, 2 months
cluster: RHEL54 - dm-log-clustered: Remove an entry from a list before freeing memory (bz544253)
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 6adfa2e69f30d1773035ce495b1a1e0aae618196
Parent: 02520053ae20cffc89cf6f221a9519797171ff59
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Tue Dec 22 03:04:18 2009 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Tue Feb 9 11:06:22 2010 -0600
dm-log-clustered: Remove an entry from a list before freeing memory (bz544253)
Error handling logic failed to remove an item from a list before freeing
it. Later, when the list is accessed, a panic occurs.
---
cmirror-kernel/src/dm-clog.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/cmirror-kernel/src/dm-clog.c b/cmirror-kernel/src/dm-clog.c
index 17e7486..de30d31 100644
--- a/cmirror-kernel/src/dm-clog.c
+++ b/cmirror-kernel/src/dm-clog.c
@@ -169,6 +169,9 @@ static int cluster_ctr(struct dm_dirty_log *log, struct dm_target *ti,
DMERR(" Userspace cluster log server not found");
if (r) {
+ spin_lock(&log_list_lock);
+ list_del(&lc->list);
+ spin_unlock(&log_list_lock);
kfree(lc);
kfree(ctr_str);
} else {
14 years, 2 months
cluster: RHEL54 - cmirror: Fix-up init script behaviour (bug 520915)
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 00efed52b5c136d82aab67b86ef8188ec2678696
Parent: a8d2b47fe7aca0bd061e86fde33be2d28cdef956
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Thu Dec 3 15:48:04 2009 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Thu Dec 3 15:49:19 2009 -0600
cmirror: Fix-up init script behaviour (bug 520915)
init script was throwing errors on 'stop' when it
shouldn't have been.
---
cmirror/init.d/cmirror | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/cmirror/init.d/cmirror b/cmirror/init.d/cmirror
index 170f004..5f1c243 100644
--- a/cmirror/init.d/cmirror
+++ b/cmirror/init.d/cmirror
@@ -55,7 +55,14 @@ stop()
{
echo -n "Stopping clustered mirror log server:"
killall clogd >& /dev/null
- if ps -C clogd >& /dev/null; then
+ for ((i=0; $i < 10; i++)); do
+ if ! ps -C clogd >& /dev/null; then
+ break;
+ fi
+ sleep 1
+ done
+
+ if [ $i -ge 10 ]; then
failure "shutdown"
echo
return 1
@@ -65,8 +72,11 @@ stop()
echo
echo -n "Unloading clustered mirror log module:"
- rmmod dm-log-clustered
- rtrn=$?
+ rtrn=0
+ if lsmod | grep -w dm_log_clustered >& /dev/null; then
+ rmmod dm-log-clustered
+ rtrn=$?
+ fi
if [ $rtrn -eq 0 ]; then
success "shutdown"
14 years, 2 months
cluster: RHEL4 - Fix bug #154902:
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 41adf63ed2763528207b0b4267b955a47a30e12e
Parent: 6df7df354ab5282061fa11367a1f6e42209f43c5
Author: Ken Preslan <kpreslan(a)redhat.com>
AuthorDate: Thu Apr 14 19:27:34 2005 +0000
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Mon Feb 8 17:31:37 2010 -0600
Fix bug #154902:
Replace the function that gets confused on certain device sizes with a
different function -- a new and improved one, that always knows what it's
doing.
---
gfs/gfs_mkfs/structures.c | 80 +++++++++++++++++++++++---------------------
1 files changed, 42 insertions(+), 38 deletions(-)
diff --git a/gfs/gfs_mkfs/structures.c b/gfs/gfs_mkfs/structures.c
index 62e69c7..273dfee 100644
--- a/gfs/gfs_mkfs/structures.c
+++ b/gfs/gfs_mkfs/structures.c
@@ -61,43 +61,43 @@
/**
- * rgrplength2bitblocks - blerg
- * @comline: the command line
- * @length: the number of blocks in a RG
+ * rgblocks2bitblocks - blerg
+ * @bsize: the FS block size
+ * @rgblocks: The total number of the blocks in the RG
+ * Also, returns the number of allocateable blocks
+ * @bitblocks: Returns the number of bitmap blocks
*
* Give a number of blocks in a RG, figure out the number of blocks
* needed for bitmaps.
*
- * Returns: the number of bitmap blocks
*/
-uint32 rgrplength2bitblocks(commandline_t *comline, uint32 length)
+static void
+rgblocks2bitblocks(unsigned int bsize,
+ uint32_t *rgblocks,
+ uint32_t *bitblocks)
{
- uint32 bitbytes;
- uint32 old_blocks = 0, blocks;
- int tries = 0;
-
- for (;;)
- {
- bitbytes = (length - old_blocks) / GFS_NBBY;
- blocks = 1;
+ unsigned int bitbytes_provided, last = 0;
+ unsigned int bitbytes_needed;
- if (bitbytes > comline->bsize - sizeof(struct gfs_rgrp))
- {
- bitbytes -= comline->bsize - sizeof(struct gfs_rgrp);
- blocks += DIV_RU(bitbytes, (comline->bsize - sizeof(struct gfs_meta_header)));
- }
+ *bitblocks = 1;
+ bitbytes_provided = bsize - sizeof(struct gfs_rgrp);
- if (blocks == old_blocks)
- break;
+ for (;;) {
+ bitbytes_needed = (*rgblocks - *bitblocks) / GFS_NBBY;
- old_blocks = blocks;
+ if (bitbytes_provided >= bitbytes_needed) {
+ if (last >= bitbytes_needed)
+ (*bitblocks)--;
+ break;
+ }
- if (tries++ > 10)
- die("confused computing bitblock length\n");
- }
+ last = bitbytes_provided;
+ (*bitblocks)++;
+ bitbytes_provided += bsize - sizeof(struct gfs_meta_header);
+ }
- return blocks;
+ *rgblocks = bitbytes_needed * GFS_NBBY;
}
@@ -111,7 +111,6 @@ uint32 rgrplength2bitblocks(commandline_t *comline, uint32 length)
void write_sb(commandline_t *comline, osi_list_t *rlist)
{
struct gfs_sb *sb;
- rgrp_list_t *rl;
uint64 jindex_dinode;
char buf[comline->bsize];
int x;
@@ -128,9 +127,15 @@ void write_sb(commandline_t *comline, osi_list_t *rlist)
/* Figure out the location of the journal index inode */
- rl = osi_list_entry(rlist->next, rgrp_list_t, list);
+ {
+ rgrp_list_t *rl = osi_list_entry(rlist->next, rgrp_list_t, list);
+ uint32_t rgblocks, bitblocks;
- jindex_dinode = rl->rg_offset + rgrplength2bitblocks(comline, rl->rg_length);
+ rgblocks = rl->rg_length;
+ rgblocks2bitblocks(comline->bsize, &rgblocks, &bitblocks);
+
+ jindex_dinode = rl->rg_offset + bitblocks;
+ }
/* Now, fill in the superblock */
@@ -493,7 +498,7 @@ static char *fill_rindex(commandline_t *comline, osi_list_t *rlist)
osi_list_t *tmp;
char *buf;
unsigned int r = 0;
- uint32 length, blocks;
+ uint32 rgblocks, bitblocks;
type_alloc(buf, char, comline->rgrps * sizeof(struct gfs_rindex));
@@ -503,25 +508,24 @@ static char *fill_rindex(commandline_t *comline, osi_list_t *rlist)
{
rl = osi_list_entry(tmp, rgrp_list_t, list);
- length = rgrplength2bitblocks(comline, rl->rg_length);
-
- blocks = rl->rg_length - length;
- blocks -= blocks % GFS_NBBY;
- comline->fssize += blocks;
+ rgblocks = rl->rg_length;
+ rgblocks2bitblocks(comline->bsize, &rgblocks, &bitblocks);
type_zalloc(ri, struct gfs_rindex, 1);
rl->ri = ri;
ri->ri_addr = rl->rg_offset;
- ri->ri_length = length;
+ ri->ri_length = bitblocks;
- ri->ri_data1 = rl->rg_offset + length;
- ri->ri_data = blocks;
+ ri->ri_data1 = rl->rg_offset + bitblocks;
+ ri->ri_data = rgblocks;
- ri->ri_bitbytes = blocks / GFS_NBBY;
+ ri->ri_bitbytes = rgblocks / GFS_NBBY;
gfs_rindex_out(ri, buf + r * sizeof(struct gfs_rindex));
+ comline->fssize += rgblocks;
+
r++;
}
14 years, 2 months
cluster: RHEL55 - cmirror: Endian fixes for mixed architecture clusters (bug 488102)
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 5239e25bfd9967a08427bcbcc15548731dad34f1
Parent: af9b2042ec0f0ca80229051bc158f18c241347ed
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Mon Feb 8 11:49:16 2010 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Mon Feb 8 11:49:56 2010 -0600
cmirror: Endian fixes for mixed architecture clusters (bug 488102)
Some data from non-like architecture machines in the cluster was
not being converted along with the communication structure.
bug 488102 also addresses or is similar to bugs 533204 and 479321.
These changes are only useful to those who have mixed arch
clusters or are running multiple versions of rhel5 at the same
time.
---
cmirror/src/compat.c | 329 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 325 insertions(+), 4 deletions(-)
diff --git a/cmirror/src/compat.c b/cmirror/src/compat.c
index 3639d99..da104a1 100644
--- a/cmirror/src/compat.c
+++ b/cmirror/src/compat.c
@@ -3,6 +3,7 @@
*
* This file is released under the GPL.
*/
+#include <stdlib.h>
#include <errno.h>
#include <stdint.h>
#include <string.h>
@@ -339,6 +340,124 @@ static int v4_to_v5(struct clog_tfr_v4 *v4, struct clog_request *rq)
return COMPAT_OFFSET + sizeof(*rq) + u_rq->data_size;
}
+#define switch_64(x, to_wire) \
+ (to_wire) ? le64_to_cpu(x) : cpu_to_le64(x)
+
+void v5_data_endian_switch(struct clog_request *rq, int to_wire)
+{
+ int i, end;
+ int64_t *pi64;
+ uint64_t *pu64;
+ uint32_t rq_type = rq->u_rq.request_type & ~DM_CLOG_RESPONSE;
+
+ if (rq->u_rq.request_type & DM_CLOG_RESPONSE) {
+ switch (rq_type) {
+ case DM_CLOG_CTR:
+ case DM_CLOG_DTR:
+ LOG_ERROR("Invalid response type in endian switch");
+ exit(EXIT_FAILURE);
+
+ case DM_CLOG_PRESUSPEND:
+ case DM_CLOG_POSTSUSPEND:
+ case DM_CLOG_RESUME:
+ case DM_CLOG_FLUSH:
+ case DM_CLOG_MARK_REGION:
+ case DM_CLOG_CLEAR_REGION:
+ case DM_CLOG_SET_REGION_SYNC:
+ case DM_CLOG_CHECKPOINT_READY:
+ case DM_CLOG_MEMBER_JOIN:
+ case DM_CLOG_STATUS_INFO:
+ case DM_CLOG_STATUS_TABLE:
+ /* No outbound data */
+ break;
+
+ case DM_CLOG_GET_REGION_SIZE:
+ case DM_CLOG_GET_SYNC_COUNT:
+ pu64 = (uint64_t *)rq->u_rq.data;
+ *pu64 = switch_64(*pu64, to_wire);
+ break;
+ case DM_CLOG_IS_CLEAN:
+ case DM_CLOG_IN_SYNC:
+ pi64 = (int64_t *)rq->u_rq.data;
+ *pi64 = switch_64(*pi64, to_wire);
+ break;
+ case DM_CLOG_GET_RESYNC_WORK:
+ case DM_CLOG_IS_REMOTE_RECOVERING:
+ pi64 = (int64_t *)rq->u_rq.data;
+ pu64 = ((uint64_t *)rq->u_rq.data) + 1;
+ *pi64 = switch_64(*pi64, to_wire);
+ *pu64 = switch_64(*pu64, to_wire);
+ break;
+ default:
+ LOG_ERROR("Unknown request type, %u", rq_type);
+ return;
+ }
+ } else {
+ switch (rq_type) {
+ case DM_CLOG_CTR:
+ case DM_CLOG_DTR:
+ LOG_ERROR("Invalid request type in endian switch");
+ exit(EXIT_FAILURE);
+
+ case DM_CLOG_PRESUSPEND:
+ case DM_CLOG_POSTSUSPEND:
+ case DM_CLOG_RESUME:
+ case DM_CLOG_GET_REGION_SIZE:
+ case DM_CLOG_FLUSH:
+ case DM_CLOG_GET_RESYNC_WORK:
+ case DM_CLOG_GET_SYNC_COUNT:
+ case DM_CLOG_STATUS_INFO:
+ case DM_CLOG_STATUS_TABLE:
+ case DM_CLOG_CHECKPOINT_READY:
+ case DM_CLOG_MEMBER_JOIN:
+ /* No incoming data */
+ break;
+ case DM_CLOG_IS_CLEAN:
+ case DM_CLOG_IN_SYNC:
+ case DM_CLOG_IS_REMOTE_RECOVERING:
+ pu64 = (uint64_t *)rq->u_rq.data;
+ *pu64 = switch_64(*pu64, to_wire);
+ break;
+ case DM_CLOG_MARK_REGION:
+ case DM_CLOG_CLEAR_REGION:
+ end = rq->u_rq.data_size/sizeof(uint64_t);
+
+ pu64 = (uint64_t *)rq->u_rq.data;
+ for (i = 0; i < end; i++)
+ pu64[i] = switch_64(pu64[i], to_wire);
+ break;
+ case DM_CLOG_SET_REGION_SYNC:
+ pu64 = (uint64_t *)rq->u_rq.data;
+ pi64 = ((int64_t *)rq->u_rq.data) + 1;
+ *pu64 = switch_64(*pu64, to_wire);
+ *pi64 = switch_64(*pi64, to_wire);
+ break;
+ default:
+ LOG_ERROR("Unknown request type, %u", rq_type);
+ exit(EXIT_FAILURE);
+ }
+ }
+}
+
+int v5_endian_to_wire(struct clog_request *rq)
+{
+ int size;
+ struct dm_ulog_request *u_rq = &rq->u_rq;
+
+ size = sizeof(*rq) + u_rq->data_size;
+
+ u_rq->error = cpu_to_le32(u_rq->error);
+ u_rq->seq = cpu_to_le32(u_rq->seq);
+ u_rq->request_type = cpu_to_le32(u_rq->request_type);
+ u_rq->data_size = cpu_to_le64(u_rq->data_size);
+
+ rq->originator = cpu_to_le32(rq->originator);
+
+ v5_data_endian_switch(rq, 1);
+
+ return size;
+}
+
int add_compatibility_layer(void *from, void **compat_version,
unsigned from_version)
{
@@ -357,6 +476,8 @@ int add_compatibility_layer(void *from, void **compat_version,
case 4:
from_size = sizeof(*v4) + v4->data_size;
break;
+ case 5:
+ return v5_endian_to_wire(from);
default:
LOG_ERROR("Invalid 'from_version'");
return -EINVAL;
@@ -396,16 +517,196 @@ static int v5_to_v3(struct clog_request *rq, struct clog_tfr_v3 *v3)
return -EINVAL;
}
+static int v5_to_v4_copy_data(struct clog_request *rq, struct clog_tfr_v4 *v4)
+{
+ int data_size = 0;
+ struct dm_ulog_request *u_rq = &rq->u_rq;
+ uint32_t rq_type = le32_to_cpu(u_rq->request_type) & ~DM_CLOG_RESPONSE;
+
+ if (le32_to_cpu(u_rq->request_type) & DM_CLOG_RESPONSE) {
+ switch (rq_type) {
+ case DM_CLOG_CTR:
+ case DM_CLOG_DTR:
+ case DM_CLOG_PRESUSPEND:
+ case DM_CLOG_POSTSUSPEND:
+ case DM_CLOG_RESUME:
+ case DM_CLOG_FLUSH:
+ case DM_CLOG_MARK_REGION:
+ case DM_CLOG_CLEAR_REGION:
+ case DM_CLOG_SET_REGION_SYNC:
+ case DM_CLOG_CHECKPOINT_READY:
+ case DM_CLOG_MEMBER_JOIN:
+ /* No outbound data */
+ break;
+
+ case DM_CLOG_GET_REGION_SIZE:
+ data_size = sizeof(uint64_t);
+ if (v4) {
+ uint64_t *a64, *b64;
+
+ a64 = (uint64_t *)rq->u_rq.data;
+ b64 = (uint64_t *)v4->data;
+ *b64 = le64_to_cpu(*a64);
+ }
+ break;
+ case DM_CLOG_IS_CLEAN:
+ case DM_CLOG_IN_SYNC:
+ data_size = sizeof(int);
+ if (v4) {
+ int *p;
+ int64_t *p64;
+
+ p = (int *)v4->data;
+ p64 = (int64_t *)rq->u_rq.data;
+ *p = (int)(le64_to_cpu(*p64));
+ }
+ break;
+ case DM_CLOG_GET_RESYNC_WORK:
+ data_size = sizeof(int32_t) +
+ sizeof(uint32_t) + sizeof(uint64_t);
+ if (v4) {
+ int32_t *pi32;
+ int64_t *pi64;
+ uint64_t *pu64, u64;
+
+ pi32 = (int32_t *)v4->data;
+ pu64 = ((uint64_t *)v4->data) + 1;
+
+ pi64 = (int64_t *)rq->u_rq.data;
+ u64 = ((uint64_t *)rq->u_rq.data)[1];
+
+ *pi32 = (int32_t)(le64_to_cpu(*pi64));
+ *pu64 = (uint64_t)le64_to_cpu(u64);
+ }
+ break;
+ case DM_CLOG_GET_SYNC_COUNT:
+ data_size = sizeof(uint64_t);
+ if (v4) {
+ uint64_t *a64, *b64;
+
+ a64 = (uint64_t *)rq->u_rq.data;
+ b64 = (uint64_t *)v4->data;
+ *b64 = le64_to_cpu(*a64);
+ }
+ break;
+ case DM_CLOG_STATUS_INFO:
+ case DM_CLOG_STATUS_TABLE:
+ data_size = u_rq->data_size;
+ if (v4)
+ memcpy(v4->data, rq->u_rq.data, data_size);
+ break;
+ case DM_CLOG_IS_REMOTE_RECOVERING:
+ data_size = sizeof(int32_t) +
+ sizeof(uint32_t) + sizeof(uint64_t);
+ if (v4) {
+ int32_t *pi32;
+ uint64_t *pu64, u64;
+ int64_t i64;
+
+ i64 = ((int64_t *)rq->u_rq.data)[0];
+ u64 = ((uint64_t *)rq->u_rq.data)[1];
+
+ pi32 = (int32_t *)v4->data;
+ pu64 = ((uint64_t *)v4->data) + 1;
+
+ *pi32 = (int32_t)(le64_to_cpu(i64));
+ *pu64 = le64_to_cpu(u64);
+ }
+ break;
+ default:
+ LOG_ERROR("Unknown request type, %u", rq_type);
+ return -EINVAL;
+ }
+ } else {
+ switch (rq_type) {
+ case DM_CLOG_CTR:
+ case DM_CLOG_DTR:
+ case DM_CLOG_PRESUSPEND:
+ case DM_CLOG_POSTSUSPEND:
+ case DM_CLOG_RESUME:
+ case DM_CLOG_GET_REGION_SIZE:
+ case DM_CLOG_FLUSH:
+ case DM_CLOG_GET_RESYNC_WORK:
+ case DM_CLOG_GET_SYNC_COUNT:
+ case DM_CLOG_STATUS_INFO:
+ case DM_CLOG_STATUS_TABLE:
+ case DM_CLOG_CHECKPOINT_READY:
+ case DM_CLOG_MEMBER_JOIN:
+ /* No incoming data */
+ break;
+ case DM_CLOG_IS_CLEAN:
+ case DM_CLOG_IN_SYNC:
+ data_size = sizeof(uint64_t);
+ if (v4) {
+ uint64_t *a64, *b64;
+
+ a64 = (uint64_t *)rq->u_rq.data;
+ b64 = (uint64_t *)v4->data;
+ *b64 = le64_to_cpu(*a64);
+ }
+ break;
+ case DM_CLOG_MARK_REGION:
+ case DM_CLOG_CLEAR_REGION:
+ data_size = le32_to_cpu(u_rq->data_size);
+ if (v4) {
+ int i, end = data_size/sizeof(uint64_t);
+ uint64_t *a64, *b64;
+
+ a64 = (uint64_t *)rq->u_rq.data;
+ b64 = (uint64_t *)v4->data;
+ for (i = 0; i < end; i++)
+ b64[i] = le64_to_cpu(a64[i]);
+ }
+ break;
+ case DM_CLOG_SET_REGION_SYNC:
+ data_size = sizeof(uint64_t) +
+ sizeof(uint32_t) + sizeof(int32_t);
+ if (v4) {
+ uint64_t u64, *pu64;
+ int64_t i64;
+ int32_t *pi32;
+
+ pu64 = (uint64_t *)v4->data;
+ pi32 = ((int32_t *)v4->data) + 3;
+
+ u64 = ((uint64_t *)rq->u_rq.data)[0];
+ i64 = ((int64_t *)rq->u_rq.data)[1];
+
+ *pu64 = le64_to_cpu(u64);
+ *pi32 = (uint32_t)(le64_to_cpu(i64));
+ }
+ break;
+ case DM_CLOG_IS_REMOTE_RECOVERING:
+ data_size = sizeof(uint64_t);
+ if (v4) {
+ uint64_t *a64, *b64;
+
+ a64 = (uint64_t *)rq->u_rq.data;
+ b64 = (uint64_t *)v4->data;
+ *b64 = le64_to_cpu(*a64);
+ }
+ break;
+ default:
+ LOG_ERROR("Unknown request type, %u", rq_type);
+ return -EINVAL;
+ }
+ }
+
+ return data_size;
+}
+
static int v5_to_v4(struct clog_request *rq, struct clog_tfr_v4 *v4)
{
+ int size;
struct dm_ulog_request *u_rq = &rq->u_rq;
- if ((sizeof(*v4) + u_rq->data_size) > (COMPAT_SIZE - COMPAT_OFFSET)) {
+ size = sizeof(*v4) + v5_to_v4_copy_data(rq, NULL);
+
+ if (size > (COMPAT_SIZE - COMPAT_OFFSET)) {
LOG_ERROR("Not enough space for compatibility data (v5->v4)");
return -EINVAL;
}
- LOG_ERROR("Stripping compatibility layer (v5->v4)");
v4->uuid_instance = (uint32_t)u_rq->luid;
memcpy(v4->uuid, u_rq->uuid, DM_UUID_LEN);
@@ -416,11 +717,30 @@ static int v5_to_v4(struct clog_request *rq, struct clog_tfr_v4 *v4)
v4->originator = rq->originator;
- memcpy(v4->data, u_rq->data, u_rq->data_size);
+ v5_to_v4_copy_data(rq, v4);
return 0;
}
+int v5_endian_from_wire(struct clog_request *rq)
+{
+ int size;
+ struct dm_ulog_request *u_rq = &rq->u_rq;
+
+ u_rq->error = le32_to_cpu(u_rq->error);
+ u_rq->seq = le32_to_cpu(u_rq->seq);
+ u_rq->request_type = le32_to_cpu(u_rq->request_type);
+ u_rq->data_size = le64_to_cpu(u_rq->data_size);
+
+ rq->originator = le32_to_cpu(rq->originator);
+
+ size = sizeof(*rq) + u_rq->data_size;
+
+ v5_data_endian_switch(rq, 0);
+
+ return size;
+}
+
int strip_compatibility_layer(void *from, void **to,
unsigned to_version)
{
@@ -462,6 +782,8 @@ int strip_compatibility_layer(void *from, void **to,
return v5_to_v3(from, (void *)buffer);
case 4:
return v5_to_v4(from, (void *)buffer);
+ case 5:
+ return v5_endian_from_wire(from);
}
return -EINVAL;
}
@@ -473,7 +795,6 @@ int strip_compatibility_layer(void *from, void **to,
*
* IOW, assume (version == to_version)
*/
-
if (report) {
LOG_ERROR("Unknown version for communication struct - forced to assume version %d", to_version);
report = 0;
14 years, 2 months