Patchwork [02/32] mke2fs: make it support inline data feature

login
register
mail settings
Submitter Zheng Liu
Date April 16, 2012, 11:39 a.m.
Message ID <1334576407-4007-3-git-send-email-wenqing.lz@taobao.com>
Download mbox | patch
Permalink /patch/152786/
State Superseded
Headers show

Comments

Zheng Liu - April 16, 2012, 11:39 a.m.
From: Zheng Liu <wenqing.lz@taobao.com>

EXT2_FEATURE_COMPAT_EXT_ATTR flag will be set when inline_data is set
because inline data feature depends on it.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 misc/mke2fs.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

Patch

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 7ec8cc2..145a6a8 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -856,7 +856,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|
@@ -1922,6 +1923,13 @@  profile_error:
 		exit(1);
 	}
 
+	/* if inline_data is set, ext_attr would be set because inline_data
+	 * depends on it.
+	 */
+	if ((fs_param.s_feature_incompat & EXT4_FEATURE_INCOMPAT_INLINE_DATA) &&
+	    !(fs_param.s_feature_compat & EXT2_FEATURE_COMPAT_EXT_ATTR))
+		fs_param.s_feature_compat |= EXT2_FEATURE_COMPAT_EXT_ATTR;
+
 	if (fs_param.s_blocks_per_group) {
 		if (fs_param.s_blocks_per_group < 256 ||
 		    fs_param.s_blocks_per_group > 8 * (unsigned) blocksize) {