All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Kulow <coolo@suse.de>
To: linux-ext4@vger.kernel.org
Subject: Re: buggy_init_scritps and e2fsprogs 1.41.9
Date: Thu, 10 Sep 2009 15:11:59 +0200	[thread overview]
Message-ID: <200909101511.59236.coolo@suse.de> (raw)
In-Reply-To: <200909101503.18497.coolo@suse.de>

[-- Attachment #1: Type: Text/Plain, Size: 794 bytes --]

Donnerstag 10 September 2009 sent Stephan Kulow:
> Donnerstag 10 September 2009 sent Stephan Kulow:
> > The release notes of 1.41.9 talk only about the exact opposite
> > case: "Fix e2fsck's buggy_init_scritps=1 so that the if the last
> > write and/or last mount times are in the future, they are corrected
> > even if buggy_init_scripts is set."
> 
> If I read the code correctly, the problem is that time_fudge is 0 for
> buggy_init_scripts=0 and as such there is no difference between
> PR_0_FUTURE_SB_LAST_MOUNT_FUDGED and PR_0_FUTURE_SB_LAST_MOUNT
> and so openSUSE always falls into the PR_0_FUTURE_SB_LAST_MOUNT
> 
> -> no PR_PREEN_OK
> 
Attached is my try to fix the problem (note that I also noticed another 
problem, it talks about LAST_MOUNT in the wtime case).

Greetings, Stephan

[-- Attachment #2: fix_super.diff --]
[-- Type: text/x-patch, Size: 1273 bytes --]

diff --git a/e2fsck/super.c b/e2fsck/super.c
index 2202967..76390af 100644
--- a/e2fsck/super.c
+++ b/e2fsck/super.c
@@ -821,9 +821,9 @@ void check_super_block(e2fsck_t ctx)
 	 */
 	if (fs->super->s_mtime > (__u32) ctx->now) {
 		pctx.num = fs->super->s_mtime;
-		problem = PR_0_FUTURE_SB_LAST_MOUNT;
-		if (fs->super->s_mtime <= (__u32) ctx->now + ctx->time_fudge)
-			problem = PR_0_FUTURE_SB_LAST_MOUNT_FUDGED;
+		problem = PR_0_FUTURE_SB_LAST_MOUNT_FUDGED;
+		if (ctx->time_fudge && fs->super->s_mtime > (__u32) ctx->now + ctx->time_fudge)
+			problem = PR_0_FUTURE_SB_LAST_MOUNT;
 		if (fix_problem(ctx, problem, &pctx)) {
 			fs->super->s_mtime = ctx->now;
 			ext2fs_mark_super_dirty(fs);
@@ -831,9 +831,9 @@ void check_super_block(e2fsck_t ctx)
 	}
 	if (fs->super->s_wtime > (__u32) ctx->now) {
 		pctx.num = fs->super->s_wtime;
-		problem = PR_0_FUTURE_SB_LAST_WRITE;
-		if (fs->super->s_wtime <= (__u32) ctx->now + ctx->time_fudge)
-			problem = PR_0_FUTURE_SB_LAST_MOUNT_FUDGED;
+		problem = PR_0_FUTURE_SB_LAST_WRITE_FUDGED;
+		if (ctx->time_fudge && fs->super->s_wtime > (__u32) ctx->now + ctx->time_fudge)
+			problem = PR_0_FUTURE_SB_LAST_WRITE;
 		if (fix_problem(ctx, problem, &pctx)) {
 			fs->super->s_wtime = ctx->now;
 			ext2fs_mark_super_dirty(fs);

  reply	other threads:[~2009-09-10 13:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-10 12:55 buggy_init_scritps and e2fsprogs 1.41.9 Stephan Kulow
2009-09-10 13:03 ` Stephan Kulow
2009-09-10 13:11   ` Stephan Kulow [this message]
2009-09-10 20:29 ` Theodore Tso
2009-09-10 20:57   ` Stephan Kulow
2009-09-11  0:55     ` Theodore Tso
2009-09-11 10:38       ` Stephan Kulow
2009-09-10 21:32   ` Theodore Tso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200909101511.59236.coolo@suse.de \
    --to=coolo@suse.de \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.