From d6a27e0048537ab6367a6aa97fbe84a423119eea Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 17 Apr 2001 02:34:41 +0000 Subject: [PATCH] ChangeLog, mke2fs.c: mke2fs.c (create_journal_dev): Call ext2fs_create_journal_superblock() first, so if it's going to error out, the user finds out before waiting for the entire device to get zero'ed. ChangeLog, util.c: util.c (parse_journal_opts): Remove code which allowed a bare number to be treated as a journal size. --- misc/ChangeLog | 8 ++++++++ misc/mke2fs.c | 14 +++++++------- misc/util.c | 7 ++----- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/misc/ChangeLog b/misc/ChangeLog index 4742d8b..e018e2b 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,8 +1,16 @@ 2001-04-16 Theodore Tso + * util.c (parse_journal_opts): Remove code which allowed a bare + number to be treated as a journal size. + * mke2fs.c, tune2fs.c: Add newlines to error messages so that they look nicer. + * mke2fs.c (create_journal_dev): Call + ext2fs_create_journal_superblock() first, so if it's going + to error out, the user finds out before waiting for the + entire device to get zero'ed. + 2001-03-26 Theodore Tso * mke2fs.8.in, tune2fs.8.in: Change man paegs to document that the diff --git a/misc/mke2fs.c b/misc/mke2fs.c index bf93636..38b870b 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -573,6 +573,13 @@ static void create_journal_dev(ext2_filsys fs) blk_t blk; int count; + retval = ext2fs_create_journal_superblock(fs, + fs->super->s_blocks_count, 0, &buf); + if (retval) { + com_err("create_journal_dev", retval, + _("while initializing journal superblock")); + exit(1); + } if (quiet) memset(&progress, 0, sizeof(progress)); else @@ -589,13 +596,6 @@ static void create_journal_dev(ext2_filsys fs) } zero_blocks(0, 0, 0, 0, 0, 0); - retval = ext2fs_create_journal_superblock(fs, - fs->super->s_blocks_count, 0, &buf); - if (retval) { - com_err("create_journal_dev", retval, - _("while initialization journal superblock")); - exit(1); - } retval = io_channel_write_blk(fs->io, fs->super->s_first_data_block+1, 1, buf); diff --git a/misc/util.c b/misc/util.c index 6ab5b7a..c4a8c2b 100644 --- a/misc/util.c +++ b/misc/util.c @@ -168,11 +168,8 @@ void parse_journal_opts(const char *opts) } else if (strcmp(token, "v1_superblock") == 0) { journal_flags |= EXT2_MKJOURNAL_V1_SUPER; continue; - } else { - journal_size = strtoul(token, &p, 0); - if (*p) - journal_usage++; - } + } else + journal_usage++; } if (journal_usage) { fprintf(stderr, _("\nBad journal options specified.\n\n" -- 1.8.3.1