From fc4f5b22409810d90446682552fc1704717f8c70 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Sat, 13 Dec 2014 21:50:13 -0500 Subject: [PATCH] misc: don't allow mk_hugefiles unless the fs supports extents The current mk_hugefile code in mke2fs doesn't support creating non-extent files, so disable the functionality when we're mkfs'ing without extent support. The fallocate patches further on will eliminate the need for this. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o --- misc/mk_hugefiles.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/mk_hugefiles.c b/misc/mk_hugefiles.c index 230844f..e42c0b9 100644 --- a/misc/mk_hugefiles.c +++ b/misc/mk_hugefiles.c @@ -476,6 +476,10 @@ errcode_t mk_hugefiles(ext2_filsys fs, const char *device_name) if (!get_bool_from_profile(fs_types, "make_hugefiles", 0)) return 0; + if (!EXT2_HAS_INCOMPAT_FEATURE(fs->super, + EXT3_FEATURE_INCOMPAT_EXTENTS)) + return EXT2_ET_EXTENT_NOT_SUPPORTED; + uid = get_int_from_profile(fs_types, "hugefiles_uid", 0); gid = get_int_from_profile(fs_types, "hugefiles_gid", 0); fs->umask = get_int_from_profile(fs_types, "hugefiles_umask", 077); -- 1.8.3.1