[Ocfs2-tools-devel] [patch 2/9] Add strict check in ocfs2_open, take 3

tao.ma at oracle.com tao.ma at oracle.com
Wed Jun 20 00:21:08 PDT 2007


In ocfs2_open, we need to check s_tunefs_flag to make sure fsck.ocfs2
won't try to clean up an aborted tunefs that it doesn't know.
Thanks Mark and Joel for pointing it out.

Index: new.ocfs2-tools/libocfs2/openfs.c
===================================================================
--- new.ocfs2-tools.orig/libocfs2/openfs.c	2007-06-19 13:43:28.000000000 -0400
+++ new.ocfs2-tools/libocfs2/openfs.c	2007-06-19 13:47:15.000000000 -0400
@@ -264,6 +264,14 @@ errcode_t ocfs2_open(const char *name, i
 		if (OCFS2_RAW_SB(fs->fs_super)->s_feature_compat &
 		    ~OCFS2_LIB_FEATURE_COMPAT_SUPP)
 			    goto out;
+
+		/* We need to check s_tunefs_flag also to make sure
+		 * fsck.ocfs2 won't try to clean up an aborted tunefs
+		 * that it doesn't know.
+		 */
+		if (OCFS2_RAW_SB(fs->fs_super)->s_tunefs_flag &
+		    ~OCFS2_LIB_ABORTED_TUNEFS_SUPP)
+			    goto out;
 	}
 
 	ret = OCFS2_ET_UNSUPP_FEATURE;

-- 



More information about the Ocfs2-tools-devel mailing list