summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2014-04-26 23:14:47 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-05-04 23:15:49 -0400
commit7664c7538a11ca03d569008e6c999d525b6ea8ed (patch)
tree27b32ae70fc19de96f4c6571b1ee8fd7e00f155e
parentbd1413d499a70be5781cfe01258ca529482e7194 (diff)
downloade2fsprogs-7664c7538a11ca03d569008e6c999d525b6ea8ed.tar.gz
e2fsck: if any problems are fixed in pass 0, check the whole file system
If there are any PREEN_OK problems fixed in check_super_block(), don't skip checking the full file system. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--e2fsck/e2fsck.h3
-rw-r--r--e2fsck/problem.c3
-rw-r--r--e2fsck/unix.c3
3 files changed, 8 insertions, 1 deletions
diff --git a/e2fsck/e2fsck.h b/e2fsck/e2fsck.h
index 913a596a..8fc99932 100644
--- a/e2fsck/e2fsck.h
+++ b/e2fsck/e2fsck.h
@@ -189,8 +189,9 @@ struct resource_track {
#define E2F_FLAG_GOT_DEVSIZE 0x0800 /* Device size has been fetched */
#define E2F_FLAG_EXITING 0x1000 /* E2fsck exiting due to errors */
#define E2F_FLAG_TIME_INSANE 0x2000 /* Time is insane */
+#define E2F_FLAG_PROBLEMS_FIXED 0x4000 /* At least one problem was fixed */
-#define E2F_RESET_FLAGS (E2F_FLAG_TIME_INSANE)
+#define E2F_RESET_FLAGS (E2F_FLAG_TIME_INSANE | E2F_FLAG_PROBLEMS_FIXED)
/*
* Defines for indicating the e2fsck pass number
diff --git a/e2fsck/problem.c b/e2fsck/problem.c
index 43a5d7b5..2296c970 100644
--- a/e2fsck/problem.c
+++ b/e2fsck/problem.c
@@ -1972,6 +1972,9 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
if (ptr->flags & PR_AFTER_CODE)
answer = fix_problem(ctx, ptr->second_code, pctx);
+ if (answer && (ptr->prompt != PROMPT_NONE))
+ ctx->flags |= E2F_FLAG_PROBLEMS_FIXED;
+
return answer;
}
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index 155e6b4a..74ef32d4 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -337,6 +337,9 @@ static void check_if_skip(e2fsck_t ctx)
int broken_system_clock;
time_t lastcheck;
+ if (ctx->flags & E2F_FLAG_PROBLEMS_FIXED)
+ return;
+
profile_get_boolean(ctx->profile, "options", "broken_system_clock",
0, 0, &broken_system_clock);
if (ctx->flags & E2F_FLAG_TIME_INSANE)