[Ocfs2-tools-devel] [PATCH 1/1] Two minor fix in tunefs.ocfs2.

Tao Ma tao.ma at oracle.com
Tue Nov 6 01:06:21 PST 2007


1. Remove the unused "fd" in ocfs2_tune_opts.
2. Add the sanity check for io_destroy_cache.

Signed-off-by: Tao Ma <tao.ma at oracle.com>
---
 tunefs.ocfs2/tunefs.c |    3 ++-
 tunefs.ocfs2/tunefs.h |    1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tunefs.ocfs2/tunefs.c b/tunefs.ocfs2/tunefs.c
index cf01110..76cd473 100644
--- a/tunefs.ocfs2/tunefs.c
+++ b/tunefs.ocfs2/tunefs.c
@@ -1723,7 +1723,8 @@ unlock:
 	block_signals(SIG_UNBLOCK);
 
 close:
-	io_destroy_cache(fs->fs_io);
+	if (fs && fs->fs_io)
+		io_destroy_cache(fs->fs_io);
 	block_signals(SIG_BLOCK);
 	if (fs && fs->fs_dlm_ctxt)
 		ocfs2_shutdown_dlm(fs);
diff --git a/tunefs.ocfs2/tunefs.h b/tunefs.ocfs2/tunefs.h
index 23bab70..3124b76 100644
--- a/tunefs.ocfs2/tunefs.h
+++ b/tunefs.ocfs2/tunefs.h
@@ -96,7 +96,6 @@ typedef struct _ocfs2_tune_opts {
 	fs_options clear_feature;
 	char *feature_string;
 	time_t tune_time;
-	int fd;
 } ocfs2_tune_opts;
 
 void print_query(char *queryfmt);
-- 
1.5.3.2.g4f337



More information about the Ocfs2-tools-devel mailing list