cluster: the annotated tag cluster-3.1.3 has been created
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 7eb116df7cfad2970ce4db22b34ba6ba01ee4948
Parent: 0000000000000000000000000000000000000000
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: 2011-06-20 15:40 +0000
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: 2011-06-20 15:40 +0000
annotated tag: cluster-3.1.3 has been created
at 7eb116df7cfad2970ce4db22b34ba6ba01ee4948 (tag)
tagging ef1c1dd818cf38d27455ce0e4678d55ae5c499eb (commit)
replaces cluster-3.1.2
cluster-3.1.3 release
Fabio M. Di Nitto (2):
cman: fix ttl default if no value is specified
dlm_controld: fix build with old (< 3.0) kernel headers
12 years, 10 months
cluster: STABLE31 - dlm_controld: fix build with old (< 3.0) kernel headers
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: ef1c1dd818cf38d27455ce0e4678d55ae5c499eb
Parent: f0b85f3680510b03058a1e6e94fc11ad913ff59b
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Jun 20 17:34:43 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Jun 20 17:35:59 2011 +0200
dlm_controld: fix build with old (< 3.0) kernel headers
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
group/dlm_controld/plock.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index f596d2f..166f6c9 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -3,10 +3,6 @@
#include <linux/dlm_plock.h>
-/* FIXME: remove this once everyone is using the version of
- * dlm_plock.h which defines it */
-#define DLM_PLOCK_FL_CLOSE 1
-
static uint32_t plock_read_count;
static uint32_t plock_recv_count;
static uint32_t plock_rate_delays;
@@ -741,7 +737,16 @@ static void do_unlock(struct lockspace *ls, struct dlm_plock_info *in,
rv = unlock_internal(ls, r, in);
+/* FIXME: remove this once everyone is using the version of
+ * dlm_plock.h which defines it */
+
+#ifndef DLM_PLOCK_FL_CLOSE
+#warning DLM_PLOCK_FL_CLOSE undefined. Enabling build workaround.
+#define DLM_PLOCK_FL_CLOSE 1
+ if (in->pad & DLM_PLOCK_FL_CLOSE) {
+#else
if (in->flags & DLM_PLOCK_FL_CLOSE) {
+#endif
clear_waiters(ls, r, in);
/* no replies for unlock-close ops */
goto skip_result;
12 years, 10 months
dlm: master - dlm_controld: fix build with old (< 3.0) kernel headers
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=13a81443...
Commit: 13a814433588ba0a9d8228dcb2e6c6dba6f3c861
Parent: 1e95a3d8c8fb8ef889b4e69fca9ac7d9c062517b
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Jun 20 17:34:43 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Jun 20 17:34:43 2011 +0200
dlm_controld: fix build with old (< 3.0) kernel headers
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
group/dlm_controld/plock.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index 967f3c0..3848308 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -3,10 +3,6 @@
#include <linux/dlm_plock.h>
-/* FIXME: remove this once everyone is using the version of
- * dlm_plock.h which defines it */
-#define DLM_PLOCK_FL_CLOSE 1
-
static uint32_t plock_read_count;
static uint32_t plock_recv_count;
static uint32_t plock_rate_delays;
@@ -789,7 +785,16 @@ static void do_unlock(struct lockspace *ls, struct dlm_plock_info *in,
rv = unlock_internal(ls, r, in);
+/* FIXME: remove this once everyone is using the version of
+ * dlm_plock.h which defines it */
+
+#ifndef DLM_PLOCK_FL_CLOSE
+#warning DLM_PLOCK_FL_CLOSE undefined. Enabling build workaround.
+#define DLM_PLOCK_FL_CLOSE 1
+ if (in->pad & DLM_PLOCK_FL_CLOSE) {
+#else
if (in->flags & DLM_PLOCK_FL_CLOSE) {
+#endif
clear_waiters(ls, r, in);
/* no replies for unlock-close ops */
goto skip_result;
12 years, 10 months
cluster: RHEL6 - cman: fix ttl default if no value is specified
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 8aed0b01c8372bde746132c6aea3465a12cd164d
Parent: 0b505a0b890dfe8898a612cd45667f0ba2086304
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Jun 20 09:49:34 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Jun 20 15:33:48 2011 +0200
cman: fix ttl default if no value is specified
when specifing a multicast address, ttl was set to 0 unless
ttl was explicitly set in cluster.conf.
Resolves: rhbz#713977
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
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 5a73fb3..cde130b 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -691,7 +691,7 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
if (objdb->object_find_next(find_handle2, &mcast_handle) == 0) {
objdb_get_string(objdb, mcast_handle, "addr", &mcast_name);
- objdb_get_int(objdb, mcast_handle, "ttl", &ttl, 0);
+ objdb_get_int(objdb, mcast_handle, "ttl", &ttl, ttl);
}
objdb->object_find_destroy(find_handle2);
}
12 years, 10 months
cluster: STABLE31 - cman: fix ttl default if no value is specified
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: f0b85f3680510b03058a1e6e94fc11ad913ff59b
Parent: a548bd3333824341373a5f9a8ff9a456c5af59c8
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Jun 20 09:49:34 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Jun 20 09:49:34 2011 +0200
cman: fix ttl default if no value is specified
when specifing a multicast address, ttl was set to 0 unless
ttl was explicitly set in cluster.conf.
Resolves: rhbz#713977
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 a890fb3..aeedf8b 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -673,7 +673,7 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
if (objdb->object_find_next(find_handle2, &mcast_handle) == 0) {
objdb_get_string(objdb, mcast_handle, "addr", &mcast_name);
- objdb_get_int(objdb, mcast_handle, "ttl", &ttl, 0);
+ objdb_get_int(objdb, mcast_handle, "ttl", &ttl, ttl);
}
objdb->object_find_destroy(find_handle2);
}
12 years, 10 months
cluster: RHEL6 - fsck.gfs2 only rebuilds one missing journal at a time
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 0b505a0b890dfe8898a612cd45667f0ba2086304
Parent: d02df4bcd1aee3ed287ee8f8c08c34c47db4cd1e
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Jun 16 13:50:54 2011 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jun 16 13:50:54 2011 -0500
fsck.gfs2 only rebuilds one missing journal at a time
This patch allows fsck.gfs2 to rebuild multiple journals in a single run.
It figures out the correct number of journals based on the number of entries
in the per_node directory. If per_node is missing, it reverts to its previous
behavior of rebuilding a single journal.
rhbz#683104
---
gfs2/fsck/fs_recovery.c | 16 +++++++++---
gfs2/fsck/initialize.c | 62 ++++++++++++++++++++++++++++++++++++++++------
2 files changed, 66 insertions(+), 12 deletions(-)
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 07c1552..b9d856e 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -636,20 +636,28 @@ int ji_update(struct gfs2_sbd *sdp)
return -1;
}
- if(!(sdp->md.journal = calloc(ip->i_di.di_entries - 2, sizeof(struct gfs2_inode *)))) {
+ /* The per_node directory will have 3 directory entries per node,
+ plus two for "." and "..". So we subtract the 2 and divide by 3.
+ If per_node is missing or damaged, we have to trust jindex has
+ the correct number of entries. */
+ if (sdp->md.pinode) /* if per_node was read in properly */
+ sdp->md.journals = (sdp->md.pinode->i_di.di_entries - 2) / 3;
+ else
+ sdp->md.journals = ip->i_di.di_entries - 2;
+
+ if(!(sdp->md.journal = calloc(sdp->md.journals,
+ sizeof(struct gfs2_inode *)))) {
log_err("Unable to allocate journal index\n");
return -1;
}
- sdp->md.journals = 0;
memset(journal_name, 0, sizeof(*journal_name));
- for(i = 0; i < ip->i_di.di_entries - 2; i++) {
+ for (i = 0; i < sdp->md.journals; i++) {
/* FIXME check snprintf return code */
snprintf(journal_name, JOURNAL_NAME_SIZE, "journal%u", i);
gfs2_lookupi(sdp->md.jiinode, journal_name, strlen(journal_name),
&jip);
sdp->md.journal[i] = jip;
}
- sdp->md.journals = ip->i_di.di_entries - 2;
return 0;
}
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 469f022..5a6fc6e 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -391,6 +391,52 @@ static int rebuild_master(struct gfs2_sbd *sdp)
}
/**
+ * lookup_per_node - Make sure the per_node directory is read in
+ *
+ * This function is used to read in the per_node directory. It is called
+ * twice. The first call tries to read in the dinode early on. That ensures
+ * that if any journals are missing, we can figure out the number of journals
+ * from per_node. However, we unfortunately can't rebuild per_node at that
+ * point in time because our resource groups aren't read in yet.
+ * The second time it's called is much later when we can rebuild it.
+ *
+ * allow_rebuild: 0 if rebuilds are not allowed
+ * 1 if rebuilds are allowed
+ */
+static void lookup_per_node(struct gfs2_sbd *sdp, int allow_rebuild)
+{
+ if (sdp->md.pinode)
+ return;
+
+ gfs2_lookupi(sdp->master_dir, "per_node", 8, &sdp->md.pinode);
+ if (sdp->md.pinode)
+ return;
+ if (!allow_rebuild) {
+ log_err( _("The gfs2 system per_node directory "
+ "inode is missing, so we might not be \nable to "
+ "rebuild missing journals this run.\n"));
+ return;
+ }
+
+ if (query( _("The gfs2 system per_node directory "
+ "inode is missing. Okay to rebuild it? (y/n) "))) {
+ int err;
+
+ err = build_per_node(sdp);
+ if (err) {
+ log_crit(_("Error rebuilding per_node directory: %s\n"),
+ strerror(err));
+ exit(-1);
+ }
+ }
+ gfs2_lookupi(sdp->master_dir, "per_node", 8, &sdp->md.pinode);
+ if (!sdp->md.pinode) {
+ log_err( _("Unable to rebuild per_node; aborting.\n"));
+ exit(-1);
+ }
+}
+
+/**
* init_system_inodes
*
* Returns: 0 on success, -1 on failure
@@ -520,14 +566,9 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
build_quota(sdp);
}
- gfs2_lookupi(sdp->master_dir, "per_node", 8, &sdp->md.pinode);
- if (!sdp->md.pinode) {
- if (query( _("The gfs2 system per_node directory inode is "
- "missing. Okay to rebuild it? (y/n) ")))
- build_per_node(sdp);
- }
-
- /* FIXME fill in per_node structure */
+ /* Try to lookup the per_node inode. If it was missing, it is now
+ safe to rebuild it. */
+ lookup_per_node(sdp, 1);
/*******************************************************************
******* Now, set boundary fields in the super block *************
*******************************************************************/
@@ -1126,6 +1167,11 @@ int initialize(struct gfs2_sbd *sbp, int force_check, int preen,
sbp->sd_sb.sb_master_dir.no_addr);
}
+ /* Look up the "per_node" inode. If there are journals missing, we
+ need to figure out what's missing from per_node. And we need all
+ our journals to be there before we can replay them. */
+ lookup_per_node(sbp, 0);
+
/* verify various things */
if(replay_journals(sbp, preen, force_check, &clean_journals)) {
12 years, 10 months
gfs2-utils: master - fsck.gfs2 only rebuilds one missing journal at a time
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 96e3a7f031d04d792b1e24758849015942631593
Parent: 8331ddfd39725e0d206633488cf5582c252e9aa5
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Jun 16 13:37:10 2011 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jun 16 13:37:10 2011 -0500
fsck.gfs2 only rebuilds one missing journal at a time
This patch allows fsck.gfs2 to rebuild multiple journals in a single run.
It figures out the correct number of journals based on the number of entries
in the per_node directory. If per_node is missing, it reverts to its previous
behavior of rebuilding a single journal.
rhbz#683104
---
gfs2/fsck/fs_recovery.c | 16 ++++++++---
gfs2/fsck/initialize.c | 68 +++++++++++++++++++++++++++++++++++++---------
2 files changed, 66 insertions(+), 18 deletions(-)
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 21f6db1..da06598 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -638,20 +638,28 @@ int ji_update(struct gfs2_sbd *sdp)
return -1;
}
- if(!(sdp->md.journal = calloc(ip->i_di.di_entries - 2, sizeof(struct gfs2_inode *)))) {
+ /* The per_node directory will have 3 directory entries per node,
+ plus two for "." and "..". So we subtract the 2 and divide by 3.
+ If per_node is missing or damaged, we have to trust jindex has
+ the correct number of entries. */
+ if (sdp->md.pinode) /* if per_node was read in properly */
+ sdp->md.journals = (sdp->md.pinode->i_di.di_entries - 2) / 3;
+ else
+ sdp->md.journals = ip->i_di.di_entries - 2;
+
+ if(!(sdp->md.journal = calloc(sdp->md.journals,
+ sizeof(struct gfs2_inode *)))) {
log_err("Unable to allocate journal index\n");
return -1;
}
- sdp->md.journals = 0;
memset(journal_name, 0, sizeof(*journal_name));
- for(i = 0; i < ip->i_di.di_entries - 2; i++) {
+ for (i = 0; i < sdp->md.journals; i++) {
/* FIXME check snprintf return code */
snprintf(journal_name, JOURNAL_NAME_SIZE, "journal%u", i);
gfs2_lookupi(sdp->md.jiinode, journal_name, strlen(journal_name),
&jip);
sdp->md.journal[i] = jip;
}
- sdp->md.journals = ip->i_di.di_entries - 2;
return 0;
}
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index c5dc7ef..697671c 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -449,6 +449,52 @@ static int rebuild_master(struct gfs2_sbd *sdp)
}
/**
+ * lookup_per_node - Make sure the per_node directory is read in
+ *
+ * This function is used to read in the per_node directory. It is called
+ * twice. The first call tries to read in the dinode early on. That ensures
+ * that if any journals are missing, we can figure out the number of journals
+ * from per_node. However, we unfortunately can't rebuild per_node at that
+ * point in time because our resource groups aren't read in yet.
+ * The second time it's called is much later when we can rebuild it.
+ *
+ * allow_rebuild: 0 if rebuilds are not allowed
+ * 1 if rebuilds are allowed
+ */
+static void lookup_per_node(struct gfs2_sbd *sdp, int allow_rebuild)
+{
+ if (sdp->md.pinode)
+ return;
+
+ gfs2_lookupi(sdp->master_dir, "per_node", 8, &sdp->md.pinode);
+ if (sdp->md.pinode)
+ return;
+ if (!allow_rebuild) {
+ log_err( _("The gfs2 system per_node directory "
+ "inode is missing, so we might not be \nable to "
+ "rebuild missing journals this run.\n"));
+ return;
+ }
+
+ if (query( _("The gfs2 system per_node directory "
+ "inode is missing. Okay to rebuild it? (y/n) "))) {
+ int err;
+
+ err = build_per_node(sdp);
+ if (err) {
+ log_crit(_("Error rebuilding per_node directory: %s\n"),
+ strerror(err));
+ exit(-1);
+ }
+ }
+ gfs2_lookupi(sdp->master_dir, "per_node", 8, &sdp->md.pinode);
+ if (!sdp->md.pinode) {
+ log_err( _("Unable to rebuild per_node; aborting.\n"));
+ exit(-1);
+ }
+}
+
+/**
* init_system_inodes
*
* Returns: 0 on success, -1 on failure
@@ -607,20 +653,9 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
}
}
- gfs2_lookupi(sdp->master_dir, "per_node", 8, &sdp->md.pinode);
- if (!sdp->md.pinode) {
- if (query( _("The gfs2 system per_node directory inode is "
- "missing. Okay to rebuild it? (y/n) "))) {
- err = build_per_node(sdp);
- if (err) {
- log_crit(_("Error rebuilding per_node directory: %s\n"),
- strerror(err));
- exit(-1);
- }
- }
- }
-
- /* FIXME fill in per_node structure */
+ /* Try to lookup the per_node inode. If it was missing, it is now
+ safe to rebuild it. */
+ lookup_per_node(sdp, 1);
/*******************************************************************
******* Now, set boundary fields in the super block *************
*******************************************************************/
@@ -1219,6 +1254,11 @@ int initialize(struct gfs2_sbd *sbp, int force_check, int preen,
sbp->sd_sb.sb_master_dir.no_addr);
}
+ /* Look up the "per_node" inode. If there are journals missing, we
+ need to figure out what's missing from per_node. And we need all
+ our journals to be there before we can replay them. */
+ lookup_per_node(sbp, 0);
+
/* verify various things */
if(replay_journals(sbp, preen, force_check, &clean_journals)) {
12 years, 10 months
cluster: the annotated tag cluster-3.1.2 has been created
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 42c2236dece1c5c6a94924f19f637fba62f2536d
Parent: 0000000000000000000000000000000000000000
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: 2011-06-16 13:40 +0000
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: 2011-06-16 13:40 +0000
annotated tag: cluster-3.1.2 has been created
at 42c2236dece1c5c6a94924f19f637fba62f2536d (tag)
tagging a548bd3333824341373a5f9a8ff9a456c5af59c8 (commit)
replaces cluster-3.1.1
cluster-3.1.2 release
David Teigland (1):
dlm_controld: clear waiting plocks for closed files
Fabio M. Di Nitto (6):
cman-preconfig: allow cman to configure corosync multicast ttl
cman init: increse the default timeout waiting for quorum
cman init: add config option to disable _controld daemons startup
config: add more totem options to relax ng schema for config validation
cman preconfig: fix segfault if we cannot determine cluster name
rgmanager: re-add slang scripts where they belong
Lon Hohberger (5):
qdiskd: Fix bad timer check
cman: Don't increment on LEAVING->MEMBER transition
Improve rgmanager's exclusive prioritization handling
rgmanager: Pause during exit if we stopped services
rgmanager: Fix reference count handling
Masatake YAMATO (1):
cman_tool: fix typo in man page
Shane Bradley (1):
cman: Clarify 'expected' option
Vladislav Bogdanov (1):
cman: do not add mcast address configuration to objdb when udpu is in use
12 years, 10 months
cluster: RHEL6 - gfs2_edit: Fix savemeta compression for older zlibs
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: d02df4bcd1aee3ed287ee8f8c08c34c47db4cd1e
Parent: 997c01bbc3c808f08879f334cd64d93e6d73fc0b
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Jun 15 13:09:41 2011 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Wed Jun 15 14:17:08 2011 +0100
gfs2_edit: Fix savemeta compression for older zlibs
gzdopen in zlib 1.2.3 parses the mode string in a different way to
subsequent versions and the mode string we use causes the older gzwrite
to fail with EBADF. This patch fixes the mode string so that the
gzwrites succeed with the old and new zlibs.
rhbz#702313
Reviewed-by: Steven Whitehouse <swhiteho(a)redhat.com>
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/savemeta.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index cb7e243..160277c 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -209,7 +209,7 @@ static void warm_fuzzy_stuff(uint64_t wfsblock, int force)
static struct metafd savemetaopen(char *out_fn, int gziplevel)
{
struct metafd mfd;
- char gzmode[5] = "rwb9";
+ char gzmode[3] = "w9";
char dft_fn[] = DFT_SAVE_FILE;
if (!out_fn) {
@@ -232,7 +232,7 @@ static struct metafd savemetaopen(char *out_fn, int gziplevel)
mfd.gziplevel = gziplevel;
if (gziplevel > 0) {
- gzmode[3] = '0' + gziplevel;
+ gzmode[1] = '0' + gziplevel;
mfd.gzfd = gzdopen(mfd.fd, gzmode);
if (!mfd.gzfd) {
fprintf(stderr, "gzdopen error: %s\n", strerror(errno));
12 years, 10 months
gfs2-utils: master - gfs2_edit: Fix savemeta compression for older zlibs
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 8331ddfd39725e0d206633488cf5582c252e9aa5
Parent: 68f8a96419c8a60f2598bc2b8ea2830fb206a2ca
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Jun 15 13:09:41 2011 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Wed Jun 15 13:09:41 2011 +0100
gfs2_edit: Fix savemeta compression for older zlibs
gzdopen in zlib 1.2.3 parses the mode string in a different way to
subsequent versions and the mode string we use causes the older gzwrite
to fail with EBADF. This patch fixes the mode string so that the
gzwrites succeed with the old and new zlibs.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/savemeta.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 1797568..0c567da 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -211,7 +211,7 @@ static void warm_fuzzy_stuff(uint64_t wfsblock, int force)
static struct metafd savemetaopen(char *out_fn, int gziplevel)
{
struct metafd mfd;
- char gzmode[5] = "rwb9";
+ char gzmode[3] = "w9";
char dft_fn[] = DFT_SAVE_FILE;
if (!out_fn) {
@@ -234,7 +234,7 @@ static struct metafd savemetaopen(char *out_fn, int gziplevel)
mfd.gziplevel = gziplevel;
if (gziplevel > 0) {
- gzmode[3] = '0' + gziplevel;
+ gzmode[1] = '0' + gziplevel;
mfd.gzfd = gzdopen(mfd.fd, gzmode);
if (!mfd.gzfd) {
fprintf(stderr, "gzdopen error: %s\n", strerror(errno));
12 years, 10 months