cluster: RHEL6 - cman: use hash_cluster_id by default
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: bd99e6e4616fddeba7b53333308a57fb327709a8
Parent: 0a06aaf5514112f90446d1dc97ada321de419473
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Fri Mar 26 18:18:19 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue May 11 06:44:37 2010 +0200
cman: use hash_cluster_id by default
This change is not yet suitable for upstream as it breaks minor rolling upgrades.
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index ef5964f..2352670 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -50,7 +50,7 @@ static char *mcast_name;
static char *cluster_name;
static char error_reason[1024] = { '\0' };
static hdb_handle_t cluster_parent_handle;
-static int use_hashed_cluster_id = 0;
+static int use_hashed_cluster_id = 1;
/*
* Exports the interface for the service
14 years
cluster: RHEL6 - cluster: remove fence_xvmd support
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 0a06aaf5514112f90446d1dc97ada321de419473
Parent: df6a61cabdc55b5a9fd2307361a63b247a8f4386
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Wed Feb 24 15:10:38 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue May 11 06:44:37 2010 +0200
cluster: remove fence_xvmd support
Product Management Request
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 75 +--------------------------------------------------
1 files changed, 1 insertions(+), 74 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 6962e2d..4578972 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -397,37 +397,6 @@ fence_join_enabled()
fi
}
-check_fence_opt()
-{
- for i in $(getopt dfi:a:p:I:C:U:c:k:u?hLXV $FENCE_XVMD_OPTS); do
- [ -$1 = $i ] && return 0
- done
- return 1
-}
-
-fence_xvmd_standalone()
-{
- check_fence_opt L
-}
-
-fence_xvmd_enabled()
-{
- fence_join_enabled || return 1
-
- #
- # Check for presence of /cluster/fence_xvmd in cluster.conf
- # (If -X is specified, it doesn't matter if it's in cluster.conf;
- # we'll start it anyway since ccsd is not required)
- #
- if cman_running && \
- ! check_fence_opt X; then
- ccs_tool query /cluster/fence_xvmd \
- > /dev/null 2>&1 || return 1
- else
- return 1
- fi
-}
-
### the real stuff starts here
start_global()
@@ -670,16 +639,6 @@ leave_fence_domain()
fi
}
-start_fence_xvmd()
-{
- start_daemon fence_xvmd "$FENCE_XVMD_OPTS"
-}
-
-stop_fence_xvmd()
-{
- stop_daemon fence_xvmd
-}
-
start()
{
breakpoint="$1"
@@ -696,12 +655,6 @@ start()
none \
"Checking Network Manager"
- runwrap start_fence_xvmd \
- fence_xvmd_standalone \
- "Starting virtual machine fencing host (standalone)"
-
- fence_xvmd_standalone && exit 0
-
runwrap start_global \
none \
"Global setup"
@@ -770,9 +723,6 @@ start()
fence_join_enabled \
"Joining fence domain"
- runwrap start_fence_xvmd \
- fence_xvmd_enabled \
- "Starting virtual machine fencing host"
}
stop()
@@ -783,16 +733,6 @@ stop()
echo $echoarg "Stopping cluster: "
- runwrap stop_fence_xvmd \
- fence_xvmd_standalone \
- "Stopping virtual machine fencing host (standalone)"
-
- fence_xvmd_standalone && exit 0
-
- runwrap stop_fence_xvmd \
- fence_xvmd_enabled \
- "Stopping virtual machine fencing host"
-
runwrap leave_fence_domain \
fence_join_enabled \
"Leaving fence domain"
@@ -836,11 +776,6 @@ stop()
cmanstatus()
{
- if fence_xvmd_standalone; then
- errmsg=$( status fence_xvmd 2>&1 )
- return $?
- fi
-
errmsg=$( status corosync 2>&1 ) || return $?
if ! cman_running; then
@@ -863,10 +798,6 @@ cmanstatus()
if cmannotifyd_enabled; then
errmsg=$( status cmannotifyd 2>&1 ) || return $?
fi
-
- if fence_xvmd_enabled; then
- errmsg=$( status fence_xvmd 2>&1 ) || return $?
- fi
}
rtrn=0
@@ -904,11 +835,7 @@ status)
cmanstatus
rtrn=$?
if [ "$rtrn" = 0 ]; then
- if fence_xvmd_standalone; then
- echo "fence_xvmd standalone is running."
- else
- echo "cluster is running."
- fi
+ echo "cluster is running."
else
echo -e "$errmsg"
fi
14 years
cluster: RHEL6 - resource-agents: drop support for drbd and smb resource agents
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: df6a61cabdc55b5a9fd2307361a63b247a8f4386
Parent: 563749115ce66a9de814642ba9f042e52589e499
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Wed Jan 13 20:20:55 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue May 11 06:44:37 2010 +0200
resource-agents: drop support for drbd and smb resource agents
Product Management Request
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
rgmanager/src/resources/Makefile | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/rgmanager/src/resources/Makefile b/rgmanager/src/resources/Makefile
index 9f8265f..1ff9bd3 100644
--- a/rgmanager/src/resources/Makefile
+++ b/rgmanager/src/resources/Makefile
@@ -8,15 +8,15 @@ include ../../../make/defines.mk
include $(OBJDIR)/make/clean.mk
RESOURCES=service.sh ip.sh nfsclient.sh nfsexport.sh \
- script.sh netfs.sh clusterfs.sh smb.sh \
+ script.sh netfs.sh clusterfs.sh \
apache.sh openldap.sh samba.sh mysql.sh \
postgres-8.sh tomcat-5.sh lvm.sh \
vm.sh SAPInstance SAPDatabase named.sh \
- ASEHAagent.sh drbd.sh
+ ASEHAagent.sh
METADATA=apache.metadata openldap.metadata samba.metadata \
mysql.metadata postgres-8.metadata tomcat-5.metadata \
- named.metadata lvm.metadata drbd.metadata
+ named.metadata lvm.metadata
EVENT_TARGETS= \
default_event_script.sl \
14 years
cluster: RHEL6 - cluster: support only xmlconfig loader
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 563749115ce66a9de814642ba9f042e52589e499
Parent: 1a42df2acb9fd11563129da0a7a6e56d1ebb09fd
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Wed Jan 13 11:35:35 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue May 11 06:44:37 2010 +0200
cluster: support only xmlconfig loader
Product Management Request
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index d13d7c0..6962e2d 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -144,8 +144,6 @@ fi
# This can be:
# xmlconfig - read directly from cluster.conf and use ricci as default
# config propagation method. (default)
-# corosync_parser - use internal corosync config file parser.
-# openaisparser - use internal openais config file parser.
[ -n "$CONFIG_LOADER" ] && cman_join_opts+=" -C $CONFIG_LOADER"
# CONFIG_VALIDATION -- select default config validation behaviour
14 years
cluster: RHEL6 - cluster: disable ldap loader support
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 1a42df2acb9fd11563129da0a7a6e56d1ebb09fd
Parent: 7dc421cbf11fcec7de9f73266cef70a54a13cb8c
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Wed Jan 13 11:25:59 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue May 11 06:44:37 2010 +0200
cluster: disable ldap loader support
Product Management Request
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 27 ---------------------------
cman/man/cman_tool.8 | 4 ++--
config/plugins/Makefile | 2 +-
config/tools/Makefile | 2 +-
config/tools/man/Makefile | 3 +--
config/tools/man/ccs_config_dump.8 | 2 +-
6 files changed, 6 insertions(+), 34 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index e0281be..d13d7c0 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -144,11 +144,6 @@ fi
# This can be:
# xmlconfig - read directly from cluster.conf and use ricci as default
# config propagation method. (default)
-# ldapconfig - read configuration from an ldap server.
-# Requires: COROSYNC_LDAP_URL or/and COROSYNC_LDAP_BASEDN
-# envvar to be set.
-# LDAP_BINDDN and LDAP_BINDPWD have to be either both set
-# or both unset.
# corosync_parser - use internal corosync config file parser.
# openaisparser - use internal openais config file parser.
[ -n "$CONFIG_LOADER" ] && cman_join_opts+=" -C $CONFIG_LOADER"
@@ -320,28 +315,6 @@ cman_running()
cman_checkconfig()
{
case "$CONFIG_LOADER" in
- ldapconfig)
- if [ -n "$COROSYNC_LDAP_URL" ] || [ -n "$COROSYNC_LDAP_BASEDN" ]; then
- if [ -n "$COROSYNC_LDAP_BINDDN" ]; then
- if [ -z "$LDAP_BINDPWD" ]; then
- errmsg="ldapconfig has been selected \
- but LDAP_BINDPWD is not set"
- return 1
- fi
- fi
- if [ -n "$LDAP_BINDPWD" ]; then
- if [ -z "$COROSYNC_LDAP_BINDDN" ]; then
- errmsg="ldapconfig has been selected \
- but LDAP_BINDDN is not set"
- return 1
- fi
- fi
- else
- errmsg="ldapconfig has been selected but neither \
- COROSYNC_LDAP_URL or COROSYNC_LDAP_BASEDN have been set"
- return 1
- fi
- ;;
xmlconfig|"")
configfile=@CONFDIR@/@CONFFILE@
[ -n "$COROSYNC_CLUSTER_CONFIG_FILE" ] && \
diff --git a/cman/man/cman_tool.8 b/cman/man/cman_tool.8
index d45e9e9..ce42bd2 100644
--- a/cman/man/cman_tool.8
+++ b/cman/man/cman_tool.8
@@ -281,8 +281,8 @@ have a configuration plugin for it, then you should specify the name of the modu
same as the filename) here.
.br
It is possible to chain configuration modules by separating them with colons. So to
-add two modules (eg) 'ldapconfig' and 'ldappreproc' to the chain start cman with
--C ldapconfig:ldappreproc
+add two modules (eg) 'configloader' and 'configpreproc' to the chain start cman with
+-C configloader:configpreproc
.br
The default value for this is 'xmlconfig'. Note that if the -X is on the command-line
then -C will be ignored.
diff --git a/config/plugins/Makefile b/config/plugins/Makefile
index d39b807..d79ca04 100644
--- a/config/plugins/Makefile
+++ b/config/plugins/Makefile
@@ -1,4 +1,4 @@
include ../../make/defines.mk
include $(OBJDIR)/make/passthrough.mk
-SUBDIRS = xml ldap
+SUBDIRS = xml
diff --git a/config/tools/Makefile b/config/tools/Makefile
index e695417..e339f3b 100644
--- a/config/tools/Makefile
+++ b/config/tools/Makefile
@@ -1,4 +1,4 @@
include ../../make/defines.mk
include $(OBJDIR)/make/passthrough.mk
-SUBDIRS=ccs_tool ldap xml man
+SUBDIRS=ccs_tool xml man
diff --git a/config/tools/man/Makefile b/config/tools/man/Makefile
index 8674f66..4a5398b 100644
--- a/config/tools/man/Makefile
+++ b/config/tools/man/Makefile
@@ -1,8 +1,7 @@
MANTARGET= \
ccs_config_dump.8 \
ccs_config_validate.8 \
- ccs_tool.8 \
- confdb2ldif.8
+ ccs_tool.8
include ../../../make/defines.mk
include $(OBJDIR)/make/install.mk
diff --git a/config/tools/man/ccs_config_dump.8 b/config/tools/man/ccs_config_dump.8
index e31d3ce..412aebb 100644
--- a/config/tools/man/ccs_config_dump.8
+++ b/config/tools/man/ccs_config_dump.8
@@ -11,7 +11,7 @@ ccs_config_dump \- Tool to generate XML output of running configuration.
\fBccs_config_dump\fP is part of the Cluster Configuration System (CCS).
It is used to dump the current running configuration in XML format.
The running configuration is, sometimes, different from the stored
-configuration on file or ldap because some subsystems store or set
+configuration on file because some subsystems store or set
some default information into the configuration. Those values are
generally not present on the on-disk version of the configuration
but are required at runtime for the cluster to work properly.
14 years
cluster: the annotated tag cluster-3.0.12 has been created
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: b1d3ffa0a4d86f32d0501eb7a27a80118ad53cb7
Parent: 0000000000000000000000000000000000000000
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: 2010-05-11 02:37 +0000
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: 2010-05-11 02:37 +0000
annotated tag: cluster-3.0.12 has been created
at b1d3ffa0a4d86f32d0501eb7a27a80118ad53cb7 (tag)
tagging 7dc421cbf11fcec7de9f73266cef70a54a13cb8c (commit)
replaces cluster-3.0.11
cluster-3.0.12 release
Abhijith Das (3):
gfs2_quota: Keep quota file length always sizeof(struct gfs2_quota) aligned
Merge branch 'STABLE3' of ssh://git.fedoraproject.org/git/cluster into mySTABLE3
gfs2_convert: gfs2_convert doesn't convert quota files
Andrew Beekhof (1):
dlm_controld.pcmk: Prevent use-of-NULL by checking the node has a valid address before adding it to configfs
Christine Caulfield (2):
Make totem.fail_to_recv_const default to 2500
cman: fix name of fail_recv_const
David Teigland (1):
gfs_controld: fix do_leave arg
Jonathan Brassow (1):
HA LVM: Use CLVM with local machine kernel targets (bz 585217)
Lon Hohberger (13):
gfs2: Fix handling of mount points with spaces
resource-agents: Clean up file system agents
rgmanager: Fix resource start/check times
rgmanager: Fix max_restart threshold handling
rgmanager: Fix build warnings
rgmanager: Add per-resource status check tolerances
resource-agents: Add status_program attribute
config: Update config schema
config: Add fail_recv_const
rgmanager: Do hard shut down if corosync dies
rgmanager: Fix man pages
qdiskd: Change votes instead of cman-visible status
qdiskd: Change votes instead of cman-visible status
Steven Whitehouse (1):
Merge branch 'STABLE3' of git://git.fedorahosted.org/cluster into STABLE3
14 years
cluster: RHEL56 - gfs2_convert: gfs2_convert doesn't convert quota files
by Abhijith Das
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 30b9fa486ce20a1788b463dad7c856d13ba05c48
Parent: febb943bb57ff440578ea7d0aeadf0d281a3158c
Author: Abhijith Das <adas(a)redhat.com>
AuthorDate: Mon May 10 11:51:02 2010 -0500
Committer: Abhijith Das <adas(a)redhat.com>
CommitterDate: Mon May 10 11:51:02 2010 -0500
gfs2_convert: gfs2_convert doesn't convert quota files
With this patch, gfs2_convert now assigns the metadata
and data blocks of the old quota file to the newly
created quota inode in the master directory.
Instead of having a initialized quota file, we now have
a quota file that preserves all teh quota information
from the gfs1 filesystem.
Resolves: rhbz#589820
Signed-off-by: Abhi Das <adas(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 54 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 8835a5b..b8a8cd9 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -333,6 +333,7 @@ static void fix_metatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
bh = ip->i_bh;
/* First, build up the metatree */
for (h = 0; h < blk->height; h++) {
+ new = 0;
lookup_block(ip, bh, h, &blk->mp, 1, &new, &block);
if (bh != ip->i_bh)
brelse(bh);
@@ -652,8 +653,6 @@ void fix_jdatatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
mh.mh_type = GFS2_METATYPE_IN;
mh.mh_format = GFS2_FORMAT_IN;
- /* This condition should never arise.
- We're always dealing with unstuffed inodes */
if (!ip->i_di.di_height)
unstuff_dinode(ip);
@@ -665,6 +664,7 @@ void fix_jdatatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
/* First, build up the metatree */
for (h = 0; h < blk->height; h++) {
+ new = 0;
lookup_block(ip, bh, h, &blk->mp, 1, &new, &block);
if (bh != ip->i_bh)
brelse(bh);
@@ -830,7 +830,7 @@ int adjust_jdata_inode(struct gfs2_sbd *sbp, struct gfs2_inode *ip)
unsigned int len;
blk = osi_list_entry(tmp, struct blocklist, list);
- /* If it's not a data block at the highest level */
+ /* If it's not a highest level indirect block */
if (blk->height != di_height - 1) {
osi_list_del(tmp);
free(blk->ptrbuf);
@@ -1256,7 +1256,8 @@ static int process_dirent_info(struct gfs2_inode *dip, struct gfs2_sbd *sbp,
if (inum.no_formal_ino) { /* if not a sentinel (placeholder) */
error = fetch_inum(sbp, inum.no_addr, &inum, NULL);
if (error) {
- log_crit("Error retrieving inode %" PRIx64 "\n", inum.no_addr);
+ log_crit("Error retrieving inode %" PRIx64 "\n",
+ (long unsigned int) inum.no_addr);
break;
}
/* fix the dirent's inode number from the fetched inum. */
@@ -1849,7 +1850,7 @@ static int journ_space_to_rg(struct gfs2_sbd *sdp)
rgdhigh = rgd;
} /* for each rg */
log_info("Addr %" PRIx64 " comes after rg at addr %" PRIx64 "\n",
- jndx->ji_addr, rgdhigh->ri.ri_addr);
+ jndx->ji_addr, (long unsigned int)(rgdhigh->ri.ri_addr));
if (!rgdhigh) { /* if we somehow didn't find one. */
log_crit("Error: No suitable rg found for journal.\n");
return -1;
@@ -2103,6 +2104,40 @@ static int check_fit(struct gfs2_sbd *sdp)
return blks_avail > blks_need;
}
+/* We fetch the old quota inode block and copy the contents of the block
+ * (minus the struct gfs2_dinode) into the new quota block. We update the
+ * inode height/size of the new quota file to that of the old one and set the
+ * old quota inode height/size to zero, so only the inode block gets freed.
+ */
+static void copy_quotas(struct gfs2_sbd *sdp)
+{
+ struct gfs2_inum inum;
+ struct gfs2_inode *oq_ip, *nq_ip;
+ int err;
+
+ err = gfs2_lookupi(sdp->master_dir, "quota", 5, &nq_ip);
+ if (err)
+ die("Couldn't lookup new quota file: %d\n", err);
+
+ gfs2_inum_in(&inum, (char *)&raw_gfs1_ondisk_sb.sb_quota_di);
+ oq_ip = inode_read(sdp, inum.no_addr);
+
+ nq_ip->i_di.di_height = oq_ip->i_di.di_height;
+ nq_ip->i_di.di_size = oq_ip->i_di.di_size;
+ memcpy(nq_ip->i_bh->b_data + sizeof(struct gfs2_dinode),
+ oq_ip->i_bh->b_data + sizeof(struct gfs2_dinode),
+ sdp->bsize - sizeof(struct gfs2_dinode));
+
+ oq_ip->i_di.di_height = 0;
+ oq_ip->i_di.di_size = 0;
+
+ bmodified(nq_ip->i_bh);
+ inode_put(&nq_ip);
+
+ bmodified(oq_ip->i_bh);
+ inode_put(&oq_ip);
+}
+
/* ------------------------------------------------------------------------- */
/* main - mainline code */
/* ------------------------------------------------------------------------- */
@@ -2221,6 +2256,15 @@ int main(int argc, char **argv)
/* Create the quota file */
build_quota(&sb2);
+ /* Copy out the master dinode */
+ {
+ struct gfs2_inode *ip = sb2.master_dir;
+ if (ip->i_bh->b_modified)
+ gfs2_dinode_out(&ip->i_di, ip->i_bh);
+ }
+ /* Copy old quotas */
+ copy_quotas(&sb2);
+
update_inode_file(&sb2);
/* Now delete the now-obsolete gfs1 files: */
remove_obsolete_gfs1(&sb2);
14 years
gfs2-utils: master - gfs2_convert: gfs2_convert doesn't convert quota files
by Abhijith Das
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: d5f06e0fff177883304727e8c64f942d2f962249
Parent: 2d960dda19b87cb9e5c3c34e28f4dba5c22fbb9f
Author: Abhijith Das <adas(a)redhat.com>
AuthorDate: Mon May 10 11:43:17 2010 -0500
Committer: Abhijith Das <adas(a)redhat.com>
CommitterDate: Mon May 10 11:49:48 2010 -0500
gfs2_convert: gfs2_convert doesn't convert quota files
With this patch, gfs2_convert now assigns the metadata
and data blocks of the old quota file to the newly
created quota inode in the master directory.
Instead of having a initialized quota file, we now have
a quota file that preserves all the quota information
from the gfs1 filesystem.
Resolves: rhbz#589823
Signed-off-by: Abhi Das <adas(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 49 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 3f72b51..84d2870 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -326,6 +326,7 @@ static void fix_metatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
bh = ip->i_bh;
/* First, build up the metatree */
for (h = 0; h < blk->height; h++) {
+ new = 0;
lookup_block(ip, bh, h, &blk->mp, 1, &new, &block);
if (bh != ip->i_bh)
brelse(bh);
@@ -645,8 +646,6 @@ static void fix_jdatatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
mh.mh_type = GFS2_METATYPE_IN;
mh.mh_format = GFS2_FORMAT_IN;
- /* This condition should never arise.
- We're always dealing with unstuffed inodes */
if (!ip->i_di.di_height)
unstuff_dinode(ip);
@@ -657,6 +656,7 @@ static void fix_jdatatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
bh = ip->i_bh;
/* First, build up the metatree */
for (h = 0; h < blk->height; h++) {
+ new = 0;
lookup_block(ip, bh, h, &blk->mp, 1, &new, &block);
if (bh != ip->i_bh)
brelse(bh);
@@ -821,7 +821,7 @@ static int adjust_jdata_inode(struct gfs2_sbd *sbp, struct gfs2_inode *ip)
unsigned int len;
blk = osi_list_entry(tmp, struct blocklist, list);
- /* If it's not a data block at the highest level */
+ /* If it's not a highest level indirect block */
if (blk->height != di_height - 1) {
osi_list_del(tmp);
free(blk->ptrbuf);
@@ -2107,6 +2107,40 @@ static int check_fit(struct gfs2_sbd *sdp)
return blks_avail > blks_need;
}
+/* We fetch the old quota inode block and copy the contents of the block
+ * (minus the struct gfs2_dinode) into the new quota block. We update the
+ * inode height/size of the new quota file to that of the old one and set the
+ * old quota inode height/size to zero, so only the inode block gets freed.
+ */
+static void copy_quotas(struct gfs2_sbd *sdp)
+{
+ struct gfs2_inum inum;
+ struct gfs2_inode *oq_ip, *nq_ip;
+ int err;
+
+ err = gfs2_lookupi(sdp->master_dir, "quota", 5, &nq_ip);
+ if (err)
+ die("Couldn't lookup new quota file: %d\n", err);
+
+ gfs2_inum_in(&inum, (char *)&raw_gfs1_ondisk_sb.sb_quota_di);
+ oq_ip = inode_read(sdp, inum.no_addr);
+
+ nq_ip->i_di.di_height = oq_ip->i_di.di_height;
+ nq_ip->i_di.di_size = oq_ip->i_di.di_size;
+ memcpy(nq_ip->i_bh->b_data + sizeof(struct gfs2_dinode),
+ oq_ip->i_bh->b_data + sizeof(struct gfs2_dinode),
+ sdp->bsize - sizeof(struct gfs2_dinode));
+
+ oq_ip->i_di.di_height = 0;
+ oq_ip->i_di.di_size = 0;
+
+ bmodified(nq_ip->i_bh);
+ inode_put(&nq_ip);
+
+ bmodified(oq_ip->i_bh);
+ inode_put(&oq_ip);
+}
+
/* ------------------------------------------------------------------------- */
/* main - mainline code */
/* ------------------------------------------------------------------------- */
@@ -2228,6 +2262,15 @@ int main(int argc, char **argv)
/* Create the quota file */
build_quota(&sb2);
+ /* Copy out the master dinode */
+ {
+ struct gfs2_inode *ip = sb2.master_dir;
+ if (ip->i_bh->b_modified)
+ gfs2_dinode_out(&ip->i_di, ip->i_bh);
+ }
+ /* Copy old quotas */
+ copy_quotas(&sb2);
+
update_inode_file(&sb2);
/* Now delete the now-obsolete gfs1 files: */
remove_obsolete_gfs1(&sb2);
14 years
cluster: STABLE3 - gfs2_convert: gfs2_convert doesn't convert quota files
by Abhijith Das
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 7dc421cbf11fcec7de9f73266cef70a54a13cb8c
Parent: 839b6b99a303f8e9a55fcb89e3f8081966180744
Author: Abhijith Das <adas(a)redhat.com>
AuthorDate: Mon May 10 11:43:17 2010 -0500
Committer: Abhijith Das <adas(a)redhat.com>
CommitterDate: Mon May 10 11:43:17 2010 -0500
gfs2_convert: gfs2_convert doesn't convert quota files
With this patch, gfs2_convert now assigns the metadata
and data blocks of the old quota file to the newly
created quota inode in the master directory.
Instead of having a initialized quota file, we now have
a quota file that preserves all the quota information
from the gfs1 filesystem.
Resolves: rhbz#589823
Signed-off-by: Abhi Das <adas(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 49 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 9621a09..642d26a 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -324,6 +324,7 @@ static void fix_metatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
bh = ip->i_bh;
/* First, build up the metatree */
for (h = 0; h < blk->height; h++) {
+ new = 0;
lookup_block(ip, bh, h, &blk->mp, 1, &new, &block);
if (bh != ip->i_bh)
brelse(bh);
@@ -643,8 +644,6 @@ static void fix_jdatatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
mh.mh_type = GFS2_METATYPE_IN;
mh.mh_format = GFS2_FORMAT_IN;
- /* This condition should never arise.
- We're always dealing with unstuffed inodes */
if (!ip->i_di.di_height)
unstuff_dinode(ip);
@@ -655,6 +654,7 @@ static void fix_jdatatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
bh = ip->i_bh;
/* First, build up the metatree */
for (h = 0; h < blk->height; h++) {
+ new = 0;
lookup_block(ip, bh, h, &blk->mp, 1, &new, &block);
if (bh != ip->i_bh)
brelse(bh);
@@ -819,7 +819,7 @@ static int adjust_jdata_inode(struct gfs2_sbd *sbp, struct gfs2_inode *ip)
unsigned int len;
blk = osi_list_entry(tmp, struct blocklist, list);
- /* If it's not a data block at the highest level */
+ /* If it's not a highest level indirect block */
if (blk->height != di_height - 1) {
osi_list_del(tmp);
free(blk->ptrbuf);
@@ -2105,6 +2105,40 @@ static int check_fit(struct gfs2_sbd *sdp)
return blks_avail > blks_need;
}
+/* We fetch the old quota inode block and copy the contents of the block
+ * (minus the struct gfs2_dinode) into the new quota block. We update the
+ * inode height/size of the new quota file to that of the old one and set the
+ * old quota inode height/size to zero, so only the inode block gets freed.
+ */
+static void copy_quotas(struct gfs2_sbd *sdp)
+{
+ struct gfs2_inum inum;
+ struct gfs2_inode *oq_ip, *nq_ip;
+ int err;
+
+ err = gfs2_lookupi(sdp->master_dir, "quota", 5, &nq_ip);
+ if (err)
+ die("Couldn't lookup new quota file: %d\n", err);
+
+ gfs2_inum_in(&inum, (char *)&raw_gfs1_ondisk_sb.sb_quota_di);
+ oq_ip = inode_read(sdp, inum.no_addr);
+
+ nq_ip->i_di.di_height = oq_ip->i_di.di_height;
+ nq_ip->i_di.di_size = oq_ip->i_di.di_size;
+ memcpy(nq_ip->i_bh->b_data + sizeof(struct gfs2_dinode),
+ oq_ip->i_bh->b_data + sizeof(struct gfs2_dinode),
+ sdp->bsize - sizeof(struct gfs2_dinode));
+
+ oq_ip->i_di.di_height = 0;
+ oq_ip->i_di.di_size = 0;
+
+ bmodified(nq_ip->i_bh);
+ inode_put(&nq_ip);
+
+ bmodified(oq_ip->i_bh);
+ inode_put(&oq_ip);
+}
+
/* ------------------------------------------------------------------------- */
/* main - mainline code */
/* ------------------------------------------------------------------------- */
@@ -2226,6 +2260,15 @@ int main(int argc, char **argv)
/* Create the quota file */
build_quota(&sb2);
+ /* Copy out the master dinode */
+ {
+ struct gfs2_inode *ip = sb2.master_dir;
+ if (ip->i_bh->b_modified)
+ gfs2_dinode_out(&ip->i_di, ip->i_bh);
+ }
+ /* Copy old quotas */
+ copy_quotas(&sb2);
+
update_inode_file(&sb2);
/* Now delete the now-obsolete gfs1 files: */
remove_obsolete_gfs1(&sb2);
14 years
cluster: STABLE3 - gfs_controld: fix do_leave arg
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 839b6b99a303f8e9a55fcb89e3f8081966180744
Parent: b7c7b8286df65a568a706b16599a4256ac8713c2
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri May 7 09:48:11 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 7 09:48:11 2010 -0500
gfs_controld: fix do_leave arg
commit 46e0a2ef75abe03455b9e15f22bed2c53a839014 changed the do_leave
arg from table to fsname, but the arg to one do_leave call was not
changed accordingly. The result was that if a mount failed in the kernel,
cleaning up (leaving) the gfs mountgroup wouldn't work.
bz 590000
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/gfs_controld/main.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/group/gfs_controld/main.c b/group/gfs_controld/main.c
index 1ca45de..dc841da 100644
--- a/group/gfs_controld/main.c
+++ b/group/gfs_controld/main.c
@@ -888,6 +888,7 @@ void process_connection(int ci)
struct gfsc_mount_args empty;
struct gfsc_mount_args *ma;
char *extra = NULL;
+ char *fsname;
int rv, extra_len;
rv = do_read(client[ci].fd, &h, sizeof(h));
@@ -943,10 +944,16 @@ void process_connection(int ci)
break;
case GFSC_CMD_FS_LEAVE:
+ fsname = strstr(ma->table, ":") + 1;
+ if (!fsname) {
+ log_error("process_connection no fsname in table");
+ goto out;
+ }
+
if (group_mode == GROUP_LIBGROUP)
- do_leave_old(ma->table, h.data);
+ do_leave_old(fsname, h.data);
else
- do_leave(ma->table, h.data);
+ do_leave(fsname, h.data);
break;
case GFSC_CMD_FS_MOUNT_DONE:
14 years