summaryrefslogtreecommitdiff
path: root/e2fsck/journal.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2001-06-02 00:38:40 +0000
committerTheodore Ts'o <tytso@mit.edu>2001-06-02 00:38:40 +0000
commit2f686ace1c8e2f680ffd450d143cdd01a649687a (patch)
tree13df96b72c7f7324794489cf82a815ea6daa96f7 /e2fsck/journal.c
parent797f5ef14e92294b329e52971d467d7af5b2993e (diff)
downloade2fsprogs-2f686ace1c8e2f680ffd450d143cdd01a649687a.tar.gz
ChangeLog, journal.c, problem.c, problem.h:
problem.c, problem.h: Change PR_0_JOURNAL_UNSUPP_INCOMPAT and PR_0_JOURNAL_UNSUPP_ROCOMPAT so they aren't fatal errors, but prompt to see if the user should abort. Removed the PR_0_JOURNAL_RESET_COMPAT problem code. journal.c (e2fsck_journal_load): If there are incompatible journal flags, just return an error code. (e2fsck_check_ext3_journal): If e2fsck_journal_load returns an error code indicating that there are incompatible journal flag, check to see if we should abort, and then offer to clear the journal.
Diffstat (limited to 'e2fsck/journal.c')
-rw-r--r--e2fsck/journal.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index 62df20da..dbfa1186 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -350,19 +350,11 @@ static errcode_t e2fsck_journal_load(journal_t *journal)
return EXT2_ET_JOURNAL_UNSUPP_VERSION;
}
- if (JFS_HAS_INCOMPAT_FEATURE(journal, ~JFS_KNOWN_INCOMPAT_FEATURES)) {
- if (!fix_problem(ctx, PR_0_JOURNAL_UNSUPP_INCOMPAT, &pctx))
- return EXT2_ET_UNSUPP_FEATURE;
- journal->j_superblock->s_feature_incompat &=
- JFS_KNOWN_INCOMPAT_FEATURES;
- }
+ if (JFS_HAS_INCOMPAT_FEATURE(journal, ~JFS_KNOWN_INCOMPAT_FEATURES))
+ return EXT2_ET_UNSUPP_FEATURE;
- if (JFS_HAS_RO_COMPAT_FEATURE(journal, ~JFS_KNOWN_ROCOMPAT_FEATURES)) {
- if (!fix_problem(ctx, PR_0_JOURNAL_UNSUPP_ROCOMPAT, &pctx))
- return EXT2_ET_RO_UNSUPP_FEATURE;
- journal->j_superblock->s_feature_ro_compat &=
- JFS_KNOWN_ROCOMPAT_FEATURES;
- }
+ if (JFS_HAS_RO_COMPAT_FEATURE(journal, ~JFS_KNOWN_ROCOMPAT_FEATURES))
+ return EXT2_ET_RO_UNSUPP_FEATURE;
/* We have now checked whether we know enough about the journal
* format to be able to proceed safely, so any other checks that
@@ -515,6 +507,12 @@ int e2fsck_check_ext3_journal(e2fsck_t ctx)
retval = e2fsck_journal_load(journal);
if (retval) {
if ((retval == EXT2_ET_CORRUPT_SUPERBLOCK) ||
+ ((retval == EXT2_ET_UNSUPP_FEATURE) &&
+ (!fix_problem(ctx, PR_0_JOURNAL_UNSUPP_INCOMPAT,
+ &pctx))) ||
+ ((retval == EXT2_ET_RO_UNSUPP_FEATURE) &&
+ (!fix_problem(ctx, PR_0_JOURNAL_UNSUPP_ROCOMPAT,
+ &pctx))) ||
((retval == EXT2_ET_JOURNAL_UNSUPP_VERSION) &&
(!fix_problem(ctx, PR_0_JOURNAL_UNSUPP_VERSION, &pctx))))
retval = e2fsck_journal_fix_corrupt_super(ctx, journal,