Skip to content

Commit

Permalink
misc: don't allow mk_hugefiles unless the fs supports extents
Browse files Browse the repository at this point in the history
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 <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
djwong authored and tytso committed Dec 14, 2014
1 parent ffe1b28 commit fc4f5b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions misc/mk_hugefiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fc4f5b2

Please sign in to comment.