From: Zheng Liu Date: Sun, 6 Jan 2013 12:25:17 +0000 (+0800) Subject: mke2fs: check extents feature when bigalloc feature is enabled X-Git-Tag: v1.42.7~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f45011df2bea466209a4b2701f2770b24518bbac;p=thirdparty%2Fe2fsprogs.git 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 Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/mke2fs.c b/misc/mke2fs.c index df9c1c148..32b4c34e5 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. */