FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 09-06-2011, 12:00 PM
Andrew Price
 
Default gfs2_edit: Initialize metafds fully in savemetaopen

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
 

Thread Tools




All times are GMT. The time now is 01:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org