* [Cluster-devel] [PATCH] gfs2_edit: Fix savemeta compression for older zlibs
@ 2011-06-15 12:18 Andrew Price
2011-06-15 12:26 ` Steven Whitehouse
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Price @ 2011-06-15 12:18 UTC (permalink / raw)
To: cluster-devel.redhat.com
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@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));
--
1.7.5.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH] gfs2_edit: Fix savemeta compression for older zlibs
2011-06-15 12:18 [Cluster-devel] [PATCH] gfs2_edit: Fix savemeta compression for older zlibs Andrew Price
@ 2011-06-15 12:26 ` Steven Whitehouse
0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2011-06-15 12:26 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
Looks good to me,
Steve.
On Wed, 2011-06-15 at 13:18 +0100, Andrew Price wrote:
> 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@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));
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-15 12:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-15 12:18 [Cluster-devel] [PATCH] gfs2_edit: Fix savemeta compression for older zlibs Andrew Price
2011-06-15 12:26 ` Steven Whitehouse
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).