cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH 1/5] gfs2_edit: Initialize metafds fully in savemetaopen
@ 2011-09-06 12:00 Andrew Price
  2011-09-06 12:00 ` [Cluster-devel] [PATCH 2/5] libgfs2: clean up some dead code in gfs2_writei Andrew Price
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Andrew Price @ 2011-09-06 12:00 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Coverity showed that savemetaopen() can return a metafd without
initializing the gzfd member. This isn't currently a problem as we only
use gzfd when it is set but this patch initializes the metafd fully to
avoid future problems.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/edit/savemeta.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 3a0e45e..9e5d111 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;
+	struct metafd mfd = {-1, NULL, NULL, gziplevel};
 	char gzmode[3] = "w9";
 	char dft_fn[] = DFT_SAVE_FILE;
 
@@ -233,7 +233,6 @@ static struct metafd savemetaopen(char *out_fn, int gziplevel)
 		exit(1);
 	}
 
-	mfd.gziplevel = gziplevel;
 	if (gziplevel > 0) {
 		gzmode[1] = '0' + gziplevel;
 		mfd.gzfd = gzdopen(mfd.fd, gzmode);
-- 
1.7.6



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-09-06 14:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-06 12:00 [Cluster-devel] [PATCH 1/5] gfs2_edit: Initialize metafds fully in savemetaopen Andrew Price
2011-09-06 12:00 ` [Cluster-devel] [PATCH 2/5] libgfs2: clean up some dead code in gfs2_writei Andrew Price
2011-09-06 12:00 ` [Cluster-devel] [PATCH 3/5] libgfs2: Remove dead code from gfs2_get_leaf Andrew Price
2011-09-06 12:00 ` [Cluster-devel] [PATCH 4/5] gfs_controld: Remove dead code from loop() Andrew Price
2011-09-06 12:43   ` Steven Whitehouse
2011-09-06 14:36   ` David Teigland
2011-09-06 12:00 ` [Cluster-devel] [PATCH 5/5] gfs2_edit: Fix segfault in find by resource group Andrew Price

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).