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

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