From: Theodore Ts'o Date: Sun, 17 Apr 2016 04:44:06 +0000 (-0400) Subject: e2fsck: clean up error messages when journal is corrupted X-Git-Tag: v1.43-WIP-2016-05-12~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d530271fb39cbf7fddf9fea55b4e4cf74142a98b;p=thirdparty%2Fe2fsprogs.git e2fsck: clean up error messages when journal is corrupted Update the tests to match with the new behavior and error messages Also fix test_one so that it doesn't print the failed test output in the case where the script does not exist. Signed-off-by: Theodore Ts'o --- diff --git a/e2fsck/unix.c b/e2fsck/unix.c index cfd33e4d8..7c7c6e8d0 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -1676,12 +1676,17 @@ failure: fatal_error(ctx, 0); } retval = e2fsck_run_ext3_journal(ctx); - if (retval) { + if (retval == EFSBADCRC) { + log_out(ctx, _("Journal checksum error " + "found in %s\n"), + ctx->device_name); + } else if (retval == EFSCORRUPTED) { + log_out(ctx, _("Journal corrupted in %s\n"), + ctx->device_name); + } else if (retval) { com_err(ctx->program_name, retval, _("while recovering journal of %s"), ctx->device_name); - if ((retval != EFSBADCRC) && (retval != EFSCORRUPTED)) - fatal_error(ctx, 0); } ext2fs_close_free(&ctx->fs); ctx->flags |= E2F_FLAG_RESTARTED; diff --git a/tests/j_corrupt_descr_csum/expect b/tests/j_corrupt_descr_csum/expect index 4e5ec6ad1..72b8f73d9 100644 --- a/tests/j_corrupt_descr_csum/expect +++ b/tests/j_corrupt_descr_csum/expect @@ -1,12 +1,12 @@ test_filesys: recovering journal -../e2fsck/e2fsck: Input/output error while recovering ext3 journal of test_filesys - -test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - -test_filesys: ********** WARNING: Filesystem still has errors ********** - -Exit status is 12 -test_filesys: recovering journal +Journal checksum error found in test_filesys +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 12/128 files (8.3% non-contiguous), 1093/2048 blocks +Exit status is 1 Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity diff --git a/tests/j_corrupt_journal_block/expect b/tests/j_corrupt_journal_block/expect index bc7570726..36a76990a 100644 --- a/tests/j_corrupt_journal_block/expect +++ b/tests/j_corrupt_journal_block/expect @@ -1,13 +1,13 @@ test_filesys: recovering journal JBD2: Invalid checksum recovering block 1090 in log -../e2fsck/e2fsck: Input/output error while recovering ext3 journal of test_filesys - -test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - -test_filesys: ********** WARNING: Filesystem still has errors ********** - -Exit status is 12 -test_filesys: recovering journal +Journal checksum error found in test_filesys +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 12/128 files (8.3% non-contiguous), 1093/2048 blocks +Exit status is 1 Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity diff --git a/tests/j_corrupt_revoke_rcount/expect.1 b/tests/j_corrupt_revoke_rcount/expect.1 index 97324f374..2d1b5cd94 100644 --- a/tests/j_corrupt_revoke_rcount/expect.1 +++ b/tests/j_corrupt_revoke_rcount/expect.1 @@ -1,8 +1,9 @@ test_filesys: recovering journal -../e2fsck/e2fsck: Invalid argument while recovering ext3 journal of test_filesys - -test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - -test_filesys: ********** WARNING: Filesystem still has errors ********** - -Exit status is 12 +../e2fsck/e2fsck: Invalid argument while recovering journal of test_filesys +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 11/512 files (9.1% non-contiguous), 1066/2048 blocks +Exit status is 1 diff --git a/tests/j_corrupt_revoke_rcount/expect.2 b/tests/j_corrupt_revoke_rcount/expect.2 index c5699018e..c746fda00 100644 --- a/tests/j_corrupt_revoke_rcount/expect.2 +++ b/tests/j_corrupt_revoke_rcount/expect.2 @@ -1,4 +1,3 @@ -test_filesys: recovering journal Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity diff --git a/tests/test_one.in b/tests/test_one.in index c2bd1a13e..fb30e5782 100644 --- a/tests/test_one.in +++ b/tests/test_one.in @@ -62,7 +62,6 @@ else else echo "$test_name: Missing test script $default_script!" fi - [ -f $test_name.failed ] && cat $test_name.failed fi if [ "$SKIP_UNLINK" != "true" ] ; then