Whamcloud - gitweb
mke2fs: always warn if 128-byte inode and inline_data
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 12 May 2014 00:24:55 +0000 (20:24 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 12 May 2014 00:26:01 +0000 (20:26 -0400)
The combination of 128-byte inodes and inline_data is silly, since
there's no room in the inode table.  Unfortunately, if neither
mke2fs.conf nor the mkfs command line options specify an inode size,
the default inode size is set to 128 bytes (by libext2fs) and the
warning isn't printed.  Therefore, always do the check-and-warning.

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

index e4e0730..565389d 100644 (file)
@@ -2303,21 +2303,22 @@ profile_error:
                                blocksize);
                        exit(1);
                }
-               /*
-                * If inode size is 128 and inline data is enabled, we need
-                * to notify users that inline data will never be useful.
-                */
-               if ((fs_param.s_feature_incompat &
-                    EXT4_FEATURE_INCOMPAT_INLINE_DATA) &&
-                   inode_size == EXT2_GOOD_OLD_INODE_SIZE) {
-                       com_err(program_name, 0,
-                               _("inode size is %d, inline data is useless"),
-                               inode_size);
-                       exit(1);
-               }
                fs_param.s_inode_size = inode_size;
        }
 
+       /*
+        * If inode size is 128 and inline data is enabled, we need
+        * to notify users that inline data will never be useful.
+        */
+       if ((fs_param.s_feature_incompat &
+            EXT4_FEATURE_INCOMPAT_INLINE_DATA) &&
+           fs_param.s_inode_size == EXT2_GOOD_OLD_INODE_SIZE) {
+               com_err(program_name, 0,
+                       _("inode size is %d, inline data is useless"),
+                       fs_param.s_inode_size);
+               exit(1);
+       }
+
        /* Make sure number of inodes specified will fit in 32 bits */
        if (num_inodes == 0) {
                unsigned long long n;