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

tao.ma at oracle.com tao.ma at oracle.com
Wed Jul 11 02:09:28 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-07-10 16:35:21.000000000 -0400
+++ new.ocfs2-tools/libocfs2/openfs.c	2007-07-10 16:36:36.000000000 -0400
@@ -264,6 +264,16 @@ 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_HAS_INCOMPAT_FEATURE(OCFS2_RAW_SB(fs->fs_super),
+					OCFS2_FEATURE_INCOMPAT_TUNEFS_INPROG) &&
+		    (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