+2001-05-23 Theodore Tso <tytso@valinux.com>
+
+ * journal.c (e2fsck_journal_reset_super): Fix bug; the reset
+ journal wasn't getting written out to disk since the dirty
+ bit wasn't being set on the buffer.
+ (e2fsck_journal_load): Don't print an error message if the
+ journal version number is wrong; just return a error code
+ reflecting this fact. If the block type in the journal
+ superblcok is obviously not a version number, report the
+ journal is corrupted.
+ (e2fsck_check_ext3_journal): On an unsupported journal
+ version, prompt to abort by default, but then offer a
+ chance to clear the journal as corrupt.
+
+ * problem.c, problem.h (PR_0_JOURNAL_UNSUPP_VERSION): Added new
+ problem code.
+
2001-05-14 Theodore Tso <tytso@valinux.com>
* pass1.c: Treat inodes with a low dtime (that were from a
case JFS_SUPERBLOCK_V2:
journal->j_format_version = 2;
break;
+
+ /*
+ * These should never appear in a journal super block, so if
+ * they do, the journal is badly corrupted.
+ */
+ case JFS_DESCRIPTOR_BLOCK:
+ case JFS_COMMIT_BLOCK:
+ case JFS_REVOKE_BLOCK:
+ return EXT2_ET_CORRUPT_SUPERBLOCK;
/* If we don't understand the superblock major type, but there
* is a magic number, then it is likely to be a new format we
* just don't understand, so leave it alone. */
default:
- com_err(ctx->program_name, EXT2_ET_UNSUPP_FEATURE,
- _("%s: journal has unrecognised format\n"),
- ctx->device_name);
- return EXT2_ET_UNSUPP_FEATURE;
+ return EXT2_ET_JOURNAL_UNSUPP_VERSION;
}
if (JFS_HAS_INCOMPAT_FEATURE(journal, ~JFS_KNOWN_INCOMPAT_FEATURES)) {
new_seq ^= u.val[i];
jsb->s_sequence = htonl(new_seq);
+ mark_buffer_dirty(journal->j_sb_buffer, 1);
ll_rw_block(WRITE, 1, &journal->j_sb_buffer);
}
retval = e2fsck_journal_load(journal);
if (retval) {
- if (retval == EXT2_ET_CORRUPT_SUPERBLOCK)
+ if ((retval == EXT2_ET_CORRUPT_SUPERBLOCK) ||
+ ((retval == EXT2_ET_JOURNAL_UNSUPP_VERSION) &&
+ (!fix_problem(ctx, PR_0_JOURNAL_UNSUPP_VERSION, &pctx))))
retval = e2fsck_journal_fix_corrupt_super(ctx, journal,
&pctx);
e2fsck_journal_release(ctx, journal, 0, 1);
{ PR_0_JOURNAL_RESET_COMPAT,
N_("Ext3 @j @S has bad feature flag(s) set.\n"),
PROMPT_CLEAR, PR_PREEN_OK|PR_PREEN_NOMSG },
+
+ /* Journal has unsupported version number */
+ { PR_0_JOURNAL_UNSUPP_VERSION,
+ N_("@j version not supported by this e2fsck.\n"),
+ PROMPT_ABORT, 0 },
/* Pass 1 errors */