]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
mke2fs: don't let resize= turn on resize_inode when meta_bg is set
authorTheodore Ts'o <tytso@mit.edu>
Fri, 18 Oct 2013 04:49:16 +0000 (21:49 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 23 Oct 2013 23:39:42 +0000 (19:39 -0400)
Passing the "-E resize=NNN" option to mke2fs sets the resize_inode
feature.  However, resize_inode and meta_bg are mutually exclusive;
unfortunately, we check this constraint before we parse the extended
options.  Fix this by moving this check after the calls
parse_extended_opts().

Reported-by: "Darrick J. Wong" <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/mke2fs.c

index cc06a97ede6e3dbd084f1c45ca46092f2fcdbaaf..64d923a77fb948e4f162568f25b059942522e13d 100644 (file)
@@ -1797,15 +1797,6 @@ profile_error:
                fs_param.s_feature_ro_compat = 0;
        }
 
-       if ((fs_param.s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) &&
-           (fs_param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE)) {
-               fprintf(stderr, _("The resize_inode and meta_bg features "
-                                 "are not compatible.\n"
-                                 "They can not be both enabled "
-                                 "simultaneously.\n"));
-               exit(1);
-       }
-
        /* Check the user's mkfs options for 64bit */
        if ((fs_param.s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) &&
            !(fs_param.s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)) {
@@ -1978,6 +1969,15 @@ profile_error:
                exit(1);
        }
 
+       if ((fs_param.s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) &&
+           (fs_param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE)) {
+               fprintf(stderr, _("The resize_inode and meta_bg features "
+                                 "are not compatible.\n"
+                                 "They can not be both enabled "
+                                 "simultaneously.\n"));
+               exit(1);
+       }
+
        if (!quiet &&
            (fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_BIGALLOC))
                fprintf(stderr, _("\nWarning: the bigalloc feature is still "