From: Theodore Ts'o Date: Sat, 16 Apr 2016 01:09:24 +0000 (-0400) Subject: e2fsck: don't abort if the journal is corrupted due to checksum errors X-Git-Tag: v1.43-WIP-2016-05-12~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27ce779d8c424629793b418bfc23578dcf67de12;p=thirdparty%2Fe2fsprogs.git e2fsck: don't abort if the journal is corrupted due to checksum errors If e2fsck_run_ext3_journal() returns an error indicating that a CRC error was detected, we shouldn't abort, but instead proceed so the file system can be fixed. Signed-off-by: Theodore Ts'o --- diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 959b4dd11..cfd33e4d8 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -53,6 +53,7 @@ extern int optind; #include "support/plausible.h" #include "e2fsck.h" #include "problem.h" +#include "jfs_user.h" #include "../version.h" /* Command line options */ @@ -1645,7 +1646,7 @@ failure: retval = e2fsck_check_ext3_journal(ctx); if (retval) { com_err(ctx->program_name, retval, - _("while checking ext3 journal for %s"), + _("while checking journal for %s"), ctx->device_name); fatal_error(ctx, 0); } @@ -1677,9 +1678,10 @@ failure: retval = e2fsck_run_ext3_journal(ctx); if (retval) { com_err(ctx->program_name, retval, - _("while recovering ext3 journal of %s"), + _("while recovering journal of %s"), ctx->device_name); - fatal_error(ctx, 0); + if ((retval != EFSBADCRC) && (retval != EFSCORRUPTED)) + fatal_error(ctx, 0); } ext2fs_close_free(&ctx->fs); ctx->flags |= E2F_FLAG_RESTARTED;