From: Jan Kara Date: Fri, 4 Jul 2014 20:24:18 +0000 (-0400) Subject: e2fsck: fix last mount time and last write time in preen mode X-Git-Tag: v1.42.11~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=87aca2ad028b9841d3ec32edd858ccc91d96ab4c;p=thirdparty%2Fe2fsprogs.git e2fsck: fix last mount time and last write time in preen mode Fixing last mount time and last write time is safe - there's no risk of loosing any important information or making corruption significantly worse even if we get it wrong. So let's just fix these times in preen mode. This allows initrd to automatically check and mount root filesystem in case system clock is wrong without having to manually set broken_system_clock variable (openSUSE uses broken_system_clock by default to avoid these problems during boot but this disables time-based checks even on systems where clock is fine so that's not ideal either). Signed-off-by: Jan Kara Signed-off-by: Theodore Ts'o --- diff --git a/e2fsck/problem.c b/e2fsck/problem.c index 53ab00bd6..4c105bb29 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -338,12 +338,12 @@ static struct e2fsck_problem problem_table[] = { /* Last mount time is in the future */ { PR_0_FUTURE_SB_LAST_MOUNT, N_("@S last mount time (%t,\n\tnow = %T) is in the future.\n"), - PROMPT_FIX, PR_NO_OK }, + PROMPT_FIX, PR_PREEN_OK | PR_NO_OK }, /* Last write time is in the future */ { PR_0_FUTURE_SB_LAST_WRITE, N_("@S last write time (%t,\n\tnow = %T) is in the future.\n"), - PROMPT_FIX, PR_NO_OK }, + PROMPT_FIX, PR_PREEN_OK | PR_NO_OK }, { PR_0_EXTERNAL_JOURNAL_HINT, N_("@S hint for external superblock @s %X. "),