summaryrefslogtreecommitdiff
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
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.
-rw-r--r--e2fsck/ChangeLog12
-rw-r--r--e2fsck/journal.c22
-rw-r--r--e2fsck/problem.c9
-rw-r--r--e2fsck/problem.h5
4 files changed, 25 insertions, 23 deletions
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog
index cf515ea6..c46f4c32 100644
--- a/e2fsck/ChangeLog
+++ b/e2fsck/ChangeLog
@@ -1,5 +1,17 @@
2001-06-01 Theodore Tso <tytso@valinux.com>
+ * 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.
+
* Makefile.in: Move include/asm/types.h.in to
lib/ext2fs/ext2_fs.h.in.
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,
diff --git a/e2fsck/problem.c b/e2fsck/problem.c
index 8c123605..fef814cf 100644
--- a/e2fsck/problem.c
+++ b/e2fsck/problem.c
@@ -265,17 +265,12 @@ static const struct e2fsck_problem problem_table[] = {
/* Journal superblock has an unknown read-only feature flag set */
{ PR_0_JOURNAL_UNSUPP_ROCOMPAT,
N_("Ext3 @j @S has an unknown read-only feature flag set.\n"),
- PROMPT_NONE, PR_FATAL, PR_0_JOURNAL_RESET_COMPAT },
+ PROMPT_ABORT, 0 },
/* Journal superblock has an unknown incompatible feature flag set */
{ PR_0_JOURNAL_UNSUPP_INCOMPAT,
N_("Ext3 @j @S has an unknown incompatible feature flag set.\n"),
- PROMPT_NONE, PR_FATAL, PR_0_JOURNAL_RESET_COMPAT },
-
- /* Journal superblock has an unknown feature flag set */
- { PR_0_JOURNAL_RESET_COMPAT,
- N_("Ext3 @j @S has bad feature flag(s) set.\n"),
- PROMPT_CLEAR, PR_PREEN_OK|PR_PREEN_NOMSG },
+ PROMPT_ABORT, 0 },
/* Journal has unsupported version number */
{ PR_0_JOURNAL_UNSUPP_VERSION,
diff --git a/e2fsck/problem.h b/e2fsck/problem.h
index 18063146..b0b6d78f 100644
--- a/e2fsck/problem.h
+++ b/e2fsck/problem.h
@@ -152,11 +152,8 @@ struct problem_context {
/* Journal has unsupported incompatible feature - abort */
#define PR_0_JOURNAL_UNSUPP_INCOMPAT 0x000026
-/* Journal has unsupported feature - reset */
-#define PR_0_JOURNAL_RESET_COMPAT 0x000027
-
/* Journal has unsupported version number */
-#define PR_0_JOURNAL_UNSUPP_VERSION 0x000028
+#define PR_0_JOURNAL_UNSUPP_VERSION 0x000027
/*
* Pass 1 errors