All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] e2fsck: Fix last mount time and last write time in preen mode
@ 2014-05-20 14:29 Jan Kara
  2014-07-04 20:32 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2014-05-20 14:29 UTC (permalink / raw)
  To: Ted Tso; +Cc: linux-ext4, Jan Kara

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 <jack@suse.cz>
---
 e2fsck/problem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Ted, what do you think about this change?

diff --git a/e2fsck/problem.c b/e2fsck/problem.c
index 2b564a83c801..a347f1905e44 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.  "),
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] e2fsck: Fix last mount time and last write time in preen mode
  2014-05-20 14:29 [PATCH] e2fsck: Fix last mount time and last write time in preen mode Jan Kara
@ 2014-07-04 20:32 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2014-07-04 20:32 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-ext4

On Tue, May 20, 2014 at 04:29:46PM +0200, Jan Kara wrote:
> 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 <jack@suse.cz>

I've accepted this change.  Note that the most common case where the
system clock is wrong, which is when the time gets reliably stuck in
the 1970's, immediately after the system boots, we end up declaring
the system clock "insane", and so we end up skipping the time-based
checks anyway.

I guess I've gotten more soft in my old age about wanting to guarantee
that time-based checks happen when they should.  If you have crappy
hardware that corrupts data blocks, or buggy kernels, time-based
checks aren't really going to save you, especially given that most
people aren't rebooting their systems all that often anyway.  Getting
people to run a script out of crontab which takes read-only snapshots
and runs fsck on those snapshots is much more likely to protect
against these sorts of issues.

Cheers,

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-04 20:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-20 14:29 [PATCH] e2fsck: Fix last mount time and last write time in preen mode Jan Kara
2014-07-04 20:32 ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.