Blame SOURCES/e2fsprogs-1.42.9-14-e2fsck-if-any-problems-are-fixed-in-pass-0-check-the.patch

0ef434
From 775ecc1dd6624fe9bb4c4769cbd4d2cf7f49ca64 Mon Sep 17 00:00:00 2001
0ef434
From: Theodore Ts'o <tytso@mit.edu>
0ef434
Date: Sat, 26 Apr 2014 23:14:47 -0400
0ef434
Subject: [PATCH 16/16] e2fsck: if any problems are fixed in pass 0, check the
0ef434
 whole file system
0ef434
0ef434
commit 7664c7538a11ca03d569008e6c999d525b6ea8ed
0ef434
0ef434
If there are any PREEN_OK problems fixed in check_super_block(), don't
0ef434
skip checking the full file system.
0ef434
0ef434
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
0ef434
---
0ef434
 e2fsck/e2fsck.h  | 3 ++-
0ef434
 e2fsck/problem.c | 3 +++
0ef434
 e2fsck/unix.c    | 3 +++
0ef434
 3 files changed, 8 insertions(+), 1 deletion(-)
0ef434
0ef434
diff --git a/e2fsck/e2fsck.h b/e2fsck/e2fsck.h
0ef434
index 913a596a..8fc99932 100644
0ef434
--- a/e2fsck/e2fsck.h
0ef434
+++ b/e2fsck/e2fsck.h
0ef434
@@ -189,8 +189,9 @@ struct resource_track {
0ef434
 #define E2F_FLAG_GOT_DEVSIZE	0x0800 /* Device size has been fetched */
0ef434
 #define E2F_FLAG_EXITING	0x1000 /* E2fsck exiting due to errors */
0ef434
 #define E2F_FLAG_TIME_INSANE	0x2000 /* Time is insane */
0ef434
+#define E2F_FLAG_PROBLEMS_FIXED	0x4000 /* At least one problem was fixed */
0ef434
 
0ef434
-#define E2F_RESET_FLAGS (E2F_FLAG_TIME_INSANE)
0ef434
+#define E2F_RESET_FLAGS (E2F_FLAG_TIME_INSANE | E2F_FLAG_PROBLEMS_FIXED)
0ef434
 
0ef434
 /*
0ef434
  * Defines for indicating the e2fsck pass number
0ef434
diff --git a/e2fsck/problem.c b/e2fsck/problem.c
0ef434
index 1aac7851..c3ba631b 100644
0ef434
--- a/e2fsck/problem.c
0ef434
+++ b/e2fsck/problem.c
0ef434
@@ -1976,6 +1976,9 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
0ef434
 	if (ptr->flags & PR_AFTER_CODE)
0ef434
 		answer = fix_problem(ctx, ptr->second_code, pctx);
0ef434
 
0ef434
+	if (answer && (ptr->prompt != PROMPT_NONE))
0ef434
+		ctx->flags |= E2F_FLAG_PROBLEMS_FIXED;
0ef434
+
0ef434
 	return answer;
0ef434
 }
0ef434
 
0ef434
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
0ef434
index bbf65d90..813fb8c5 100644
0ef434
--- a/e2fsck/unix.c
0ef434
+++ b/e2fsck/unix.c
0ef434
@@ -339,6 +339,9 @@ static void check_if_skip(e2fsck_t ctx)
0ef434
 	int broken_system_clock;
0ef434
 	time_t lastcheck;
0ef434
 
0ef434
+	if (ctx->flags & E2F_FLAG_PROBLEMS_FIXED)
0ef434
+		return;
0ef434
+
0ef434
 	profile_get_boolean(ctx->profile, "options", "broken_system_clock",
0ef434
 			    0, 0, &broken_system_clock);
0ef434
 	if (ctx->flags & E2F_FLAG_TIME_INSANE)
0ef434
-- 
0ef434
2.20.1
0ef434