Whamcloud - gitweb
e2fsck: if any problems are fixed in pass 0, check the whole file system
authorTheodore Ts'o <tytso@mit.edu>
Sun, 27 Apr 2014 03:14:47 +0000 (23:14 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 5 May 2014 03:15:49 +0000 (23:15 -0400)
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>
e2fsck/e2fsck.h
e2fsck/problem.c
e2fsck/unix.c

index 913a596..8fc9993 100644 (file)
@@ -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
index 43a5d7b..2296c97 100644 (file)
@@ -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;
 }
 
index 155e6b4..74ef32d 100644 (file)
@@ -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)