From: Theodore Ts'o Date: Thu, 6 Feb 2014 19:34:12 +0000 (-0500) Subject: mke2fs: minor bugfixes for mk_hugefiles X-Git-Tag: v1.42.9.wc1~66 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=71d920e3023ad74c6ef879ff18d54438a777ef06;p=tools%2Fe2fsprogs.git mke2fs: minor bugfixes for mk_hugefiles Interpret "zero_hugefiles" relation in mke2fs.conf as a boolean value, as documented in the man page. If the hugefile is larger than 2GB, set the large_file file system feature so e2fsck doesn't complain. Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/mk_hugefiles.c b/misc/mk_hugefiles.c index eb91f0c..debc3fe 100644 --- a/misc/mk_hugefiles.c +++ b/misc/mk_hugefiles.c @@ -349,8 +349,8 @@ errcode_t mk_hugefiles(ext2_filsys fs) align = parse_num_blocks2(t, fs->super->s_log_block_size); free(t); num_blocks = round_up_align(num_blocks, align); - zero_hugefile = get_int_from_profile(fs_types, "zero_hugefiles", - zero_hugefile); + zero_hugefile = get_bool_from_profile(fs_types, "zero_hugefiles", + zero_hugefile); t = get_string_from_profile(fs_types, "hugefiles_dir", "/"); retval = create_directory(fs, t, &dir); @@ -402,6 +402,11 @@ errcode_t mk_hugefiles(ext2_filsys fs) goal = get_start_block(fs, num_slack); goal = round_up_align(goal, align); + if ((num_blocks ? num_blocks : fs_blocks) > + (0x80000000UL / fs->blocksize)) + fs->super->s_feature_ro_compat |= + EXT2_FEATURE_RO_COMPAT_LARGE_FILE; + if (!quiet) { if (zero_hugefile && verbose) printf(_("Huge files will be zero'ed\n"));