diff options
author | Theodore Ts'o <tytso@mit.edu> | 2008-07-06 20:24:29 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-07-06 20:24:29 -0400 |
commit | b4d5105b2527a5279cf5b885b957e1e07a53e725 (patch) | |
tree | 786d35ce950fd3373d1e4bc3250a0d4a0a38183e /misc/mke2fs.c | |
parent | 69d813520cf14f5700c38c82b5c147aa3756bbd9 (diff) | |
download | e2fsprogs-b4d5105b2527a5279cf5b885b957e1e07a53e725.tar.gz |
mke2fs: Use a fs_type of 'journal' when creating an external journal
If creating a an external journal via "mke2fs -O journal_dev",
override the fs_type list (i.e., "ext2", "small"), and replace it with
an fs_type list of "journal". This will prevent external journals
smaller than 512MB from being created with a block size of 1k, which
is not very useful and leads to much confusion.
Addresses-Debian-Bug: #488663
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'misc/mke2fs.c')
-rw-r--r-- | misc/mke2fs.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/misc/mke2fs.c b/misc/mke2fs.c index acb30549..c47470bf 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -1446,25 +1446,6 @@ static void PRS(int argc, char *argv[]) fprintf(stderr, _("Failed to parse fs types list\n")); exit(1); } - if (verbose) { - fputs("Fs_types for mke2fs.conf resolution: ", stdout); - print_str_list(fs_types); - } - - if (!fs_type) { - int megs = (__u64)fs_param.s_blocks_count * - (EXT2_BLOCK_SIZE(&fs_param) / 1024) / 1024; - - if (fs_param.s_feature_incompat & - EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) - fs_type = "journal"; - else if (megs <= 3) - fs_type = "floppy"; - else if (megs <= 512) - fs_type = "small"; - else - fs_type = "default"; - } /* Figure out what features should be enabled */ @@ -1492,6 +1473,16 @@ static void PRS(int argc, char *argv[]) if (tmp) free(tmp); + if (fs_param.s_feature_incompat & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) { + fs_types[0] = strdup("journal"); + fs_types[1] = 0; + } + + if (verbose) { + fputs(_("fs_types for mke2fs.conf resolution: "), stdout); + print_str_list(fs_types); + } + if (r_opt == EXT2_GOOD_OLD_REV && (fs_param.s_feature_compat || fs_param.s_feature_incompat || fs_param.s_feature_incompat)) { |