From: Zheng Liu Date: Mon, 3 Mar 2014 06:02:14 +0000 (-0500) Subject: mke2fs: add inline_data support in mke2fs X-Git-Tag: v1.43-WIP-2015-05-18~336 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b451c8dd391a93f16572d937c5b563441bf286f3;p=tools%2Fe2fsprogs.git mke2fs: add inline_data support in mke2fs Now inline_data doesn't depend on ext_attr. Hence we don't need to do this sanity check. But if the inode size is too small (128 bytes), inline_data will be useless because we couldn't save data in ibody extented attribute. So we need to report this error. Signed-off-by: Zheng Liu Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/ext4.5.in b/misc/ext4.5.in index 5ec39f5..a8ebf67 100644 --- a/misc/ext4.5.in +++ b/misc/ext4.5.in @@ -149,6 +149,9 @@ option to or .BR tune2fs(8). .TP +.B inline_data +Allow data to be stored in the inode and extended attribute area +.TP .B large_file .br This feature flag is set automatically by modern kernels when a file diff --git a/misc/mke2fs.c b/misc/mke2fs.c index facbe4c..2b233d6 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -1062,7 +1062,8 @@ static __u32 ok_features[3] = { EXT2_FEATURE_INCOMPAT_META_BG| EXT4_FEATURE_INCOMPAT_FLEX_BG| EXT4_FEATURE_INCOMPAT_MMP | - EXT4_FEATURE_INCOMPAT_64BIT, + EXT4_FEATURE_INCOMPAT_64BIT| + EXT4_FEATURE_INCOMPAT_INLINE_DATA, /* R/O compat */ EXT2_FEATURE_RO_COMPAT_LARGE_FILE| EXT4_FEATURE_RO_COMPAT_HUGE_FILE| @@ -2222,7 +2223,8 @@ profile_error: "See https://ext4.wiki.kernel.org/" "index.php/Quota for more information\n\n")); - /* Since sparse_super is the default, we would only have a problem + /* + * Since sparse_super is the default, we would only have a problem * here if it was explicitly disabled. */ if ((fs_param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE) && @@ -2278,6 +2280,18 @@ 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; }