From: Darrick J. Wong Date: Sat, 12 Oct 2013 01:20:22 +0000 (-0400) Subject: mke2fs: complain about creating 64bit filesystems without extents X-Git-Tag: v1.42.9~129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d11f92af3563ce9a235286e6e10d1ebf29a2a4a8;p=thirdparty%2Fe2fsprogs.git mke2fs: complain about creating 64bit filesystems without extents A 64bit filesystem without extents is not terribly useful, because the old block map format does not support pointing to high block numbers. Warn the user who tries to create such an animal. Signed-off-by: Darrick J. Wong Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 22c2815db..cc06a97ed 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -1806,6 +1806,14 @@ profile_error: exit(1); } + /* Check the user's mkfs options for 64bit */ + if ((fs_param.s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) && + !(fs_param.s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)) { + printf(_("Extents MUST be enabled for a 64-bit filesystem. " + "Pass -O extents to rectify.\n")); + exit(1); + } + /* Set first meta blockgroup via an environment variable */ /* (this is mostly for debugging purposes) */ if ((fs_param.s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) &&