[Ocfs2-tools-devel] [PATCH 08/11] tunefs.ocfs2: Don't set incompat flags unless we're really changing slots

Sunil Mushran sunil.mushran at oracle.com
Thu Sep 27 17:14:31 PDT 2007


From: Mark Fasheh <mark.fasheh at oracle.com>

opts.num_slots is initialized to zero, which is always less than max_slots
on a valid ocfs2 file system. If tunefs.ocfs2 is called at all for anything,
even without "-N" the test for setting the removing-slots incompat flag
succeeds because it's not explicitely checking for zero.

This means that simple operations like changing mount type leave the
incompat bit set in the super block, rendering the file system unmountable
until fsck.ocfs2 is run.

Signed-off-by: Mark Fasheh <mark.fasheh at oracle.com>
Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 tunefs.ocfs2/tunefs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tunefs.ocfs2/tunefs.c b/tunefs.ocfs2/tunefs.c
index 4bb9f82..fbdb9e3 100644
--- a/tunefs.ocfs2/tunefs.c
+++ b/tunefs.ocfs2/tunefs.c
@@ -1452,7 +1452,8 @@ int main(int argc, char **argv)
 	}
 
 	/* Set resize incompat flag on superblock */
-	if (opts.num_blocks || opts.num_slots < max_slots) {
+	if (opts.num_blocks ||
+	    (opts.num_slots && opts.num_slots < max_slots)) {
 		if (opts.num_blocks)
 			OCFS2_RAW_SB(fs->fs_super)->s_feature_incompat |=
 				OCFS2_FEATURE_INCOMPAT_RESIZE_INPROG;
-- 
1.5.2.5




More information about the Ocfs2-tools-devel mailing list