diff options
author | Theodore Ts'o <tytso@mit.edu> | 2012-06-12 12:53:18 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-06-12 12:53:18 -0700 |
commit | 5886dc5cdcccd3d09a208d41d8c23748c25a2a22 (patch) | |
tree | 83e2925a338a340c53cb23abaac6c0fc986cdab5 | |
parent | 0a02698f2851f419aa75536afb5f040a5c9ce002 (diff) | |
parent | fada366033e80c119867eb303e8b48a8e027a9be (diff) | |
download | e2fsprogs-ics-plus-aosp.tar.gz |
am fada3660: e2fsck: correctly propagate error from journal to superblocktools_r21ics-plus-aosp
* commit 'fada366033e80c119867eb303e8b48a8e027a9be':
e2fsck: correctly propagate error from journal to superblock
-rw-r--r-- | e2fsck/journal.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/e2fsck/journal.c b/e2fsck/journal.c index 95affda3..bead931e 100644 --- a/e2fsck/journal.c +++ b/e2fsck/journal.c @@ -843,15 +843,7 @@ static errcode_t recover_ext3_journal(e2fsck_t ctx) if (journal->j_failed_commit) { pctx.ino = journal->j_failed_commit; fix_problem(ctx, PR_0_JNL_TXN_CORRUPT, &pctx); - ctx->fs->super->s_state |= EXT2_ERROR_FS; - ext2fs_mark_super_dirty(ctx->fs); - } - - - if (journal->j_superblock->s_errno) { - ctx->fs->super->s_state |= EXT2_ERROR_FS; - ext2fs_mark_super_dirty(ctx->fs); - journal->j_superblock->s_errno = 0; + journal->j_superblock->s_errno = -EINVAL; mark_buffer_dirty(journal->j_sb_buffer); } @@ -908,7 +900,13 @@ int e2fsck_run_ext3_journal(e2fsck_t ctx) /* Set the superblock flags */ e2fsck_clear_recover(ctx, recover_retval); - return recover_retval; + + /* + * Do one last sanity check, and propagate journal->s_errno to + * the EXT2_ERROR_FS flag in the fs superblock if needed. + */ + retval = e2fsck_check_ext3_journal(ctx); + return retval ? retval : recover_retval; } /* |