Whamcloud - gitweb
e2fsck: clean up error messages when journal is corrupted
authorTheodore Ts'o <tytso@mit.edu>
Sun, 17 Apr 2016 04:44:06 +0000 (00:44 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 17 Apr 2016 04:44:06 +0000 (00:44 -0400)
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 <tytso@mit.edu>
e2fsck/unix.c
tests/j_corrupt_descr_csum/expect
tests/j_corrupt_journal_block/expect
tests/j_corrupt_revoke_rcount/expect.1
tests/j_corrupt_revoke_rcount/expect.2
tests/test_one.in

index cfd33e4..7c7c6e8 100644 (file)
@@ -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;
index 4e5ec6a..72b8f73 100644 (file)
@@ -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
index bc75707..36a7699 100644 (file)
@@ -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
index 97324f3..2d1b5cd 100644 (file)
@@ -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
index c569901..c746fda 100644 (file)
@@ -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
index c2bd1a1..fb30e57 100644 (file)
@@ -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