From be93ef0c14c11f9891094d66563d2998b917eb6c Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 31 Oct 2002 18:38:55 -0500 Subject: [PATCH] pass1.c (e2fsck_pass1): Check the superblock write time to see whether or not we can safely do the LOW_DTIME checks. (Addresses Sourceforge bug #620980) --- e2fsck/ChangeLog | 6 ++++++ e2fsck/pass1.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 9fbf845..86d5c1b 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,9 @@ +2002-10-31 Theodore Ts'o + + * pass1.c (e2fsck_pass1): Check the superblock write time to see + whether or not we can safely do the LOW_DTIME checks. + (Addresses Sourceforge bug #620980) + 2002-10-30 Theodore Ts'o * Makefile.in (install): Search all compression extensions when diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index f25be76..52cdb04 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -272,6 +272,7 @@ void e2fsck_pass1(e2fsck_t ctx) struct scan_callback_struct scan_struct; struct ext2_super_block *sb = ctx->fs->super; int imagic_fs; + int busted_fs_time = 0; #ifdef RESOURCE_TRACK init_resource_track(&rtrack); @@ -394,6 +395,9 @@ void e2fsck_pass1(e2fsck_t ctx) if (ctx->progress) if ((ctx->progress)(ctx, 1, 0, ctx->fs->group_desc_count)) return; + if (fs->super->s_wtime < fs->super->s_inodes_count) + busted_fs_time = 1; + while (1) { pctx.errcode = ext2fs_get_next_inode(scan, &ino, &inode); if (ctx->flags & E2F_FLAG_SIGNAL_MASK) @@ -543,7 +547,7 @@ void e2fsck_pass1(e2fsck_t ctx) * than nothing. The right answer is that there * shouldn't be any bugs in the orphan list handling. :-) */ - if (inode.i_dtime && + if (inode.i_dtime && !busted_fs_time && inode.i_dtime < ctx->fs->super->s_inodes_count) { if (fix_problem(ctx, PR_1_LOW_DTIME, &pctx)) { inode.i_dtime = inode.i_links_count ? -- 1.8.3.1