From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH RHEL6] gfs2_edit: Fix savemeta compression for older zlibs
Date: Wed, 15 Jun 2011 14:10:02 +0100 [thread overview]
Message-ID: <1308143402-28876-1-git-send-email-anprice@redhat.com> (raw)
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
Signed-off-by: Andrew Price <anprice@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));
--
1.7.5.2
next reply other threads:[~2011-06-15 13:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 13:10 Andrew Price [this message]
2011-06-15 13:15 ` [Cluster-devel] [PATCH RHEL6] gfs2_edit: Fix savemeta compression for older zlibs Steven Whitehouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1308143402-28876-1-git-send-email-anprice@redhat.com \
--to=anprice@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).