aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZheng Liu <wenqing.lz@taobao.com>2013-01-06 20:25:17 +0800
committerTheodore Ts'o <tytso@mit.edu>2013-01-08 10:35:45 -0500
commitf45011df2bea466209a4b2701f2770b24518bbac (patch)
treef88b581f5f07bcb409774d4674c879324e5c522c
parent027b0577d4e5081a4d28dff9289559d38a36d533 (diff)
downloade2fsprogs-f45011df2bea466209a4b2701f2770b24518bbac.tar.gz
e2fsprogs-f45011df2bea466209a4b2701f2770b24518bbac.tar.xz
e2fsprogs-f45011df2bea466209a4b2701f2770b24518bbac.zip
mke2fs: check extents feature when bigalloc feature is enabled
When bigalloc feature is enabled in mkfs, extents feature also needs to be enabled. But now when bigalloc feature is enabled without extents feature, users will not get any warning messages until they try to mount this file system. Signed-off-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--misc/mke2fs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index df9c1c14..32b4c34e 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1921,6 +1921,15 @@ profile_error:
if (extended_opts)
parse_extended_opts(&fs_param, extended_opts);
+ /* Can't support bigalloc feature without extents feature */
+ if ((fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_BIGALLOC) &&
+ !(fs_param.s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)) {
+ com_err(program_name, 0,
+ _("Can't support bigalloc feature without "
+ "extents feature"));
+ exit(1);
+ }
+
/* Since sparse_super is the default, we would only have a problem
* here if it was explicitly disabled.
*/