summaryrefslogtreecommitdiff
path: root/e2fsck/super.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-06-07 12:42:40 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-06-07 12:42:40 -0400
commit97d26ce9e3589e9f5fa17014467a9730a884d158 (patch)
tree1321a9170832aebc6c5017a70d6d73957cf31ba4 /e2fsck/super.c
parentc561e751a17c85b898d74f8cc16daad5f29500a4 (diff)
parent296b9d696ab491f29d6d2083982e39b0ff3dab1f (diff)
downloade2fsprogs-97d26ce9e3589e9f5fa17014467a9730a884d158.tar.gz
Merge branch 'maint' into next
Conflicts: e2fsck/journal.c e2fsck/pass1.c e2fsck/pass2.c misc/mke2fs.c
Diffstat (limited to 'e2fsck/super.c')
-rw-r--r--e2fsck/super.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/e2fsck/super.c b/e2fsck/super.c
index c8c44029..caba72cd 100644
--- a/e2fsck/super.c
+++ b/e2fsck/super.c
@@ -465,6 +465,7 @@ void check_super_block(e2fsck_t ctx)
int ipg_max;
int inode_size;
int accept_time_fudge;
+ int broken_system_clock;
dgrp_t i;
blk_t should_be;
struct problem_context pctx;
@@ -826,11 +827,16 @@ void check_super_block(e2fsck_t ctx)
0, accept_time_fudge, &accept_time_fudge);
ctx->time_fudge = accept_time_fudge ? 86400 : 0;
+ profile_get_boolean(ctx->profile, "options", "broken_system_clock",
+ 0, 0, &broken_system_clock);
+
/*
* Check to see if the superblock last mount time or last
* write time is in the future.
*/
- if (fs->super->s_mtime > (__u32) ctx->now) {
+ if (!broken_system_clock &&
+ !(ctx->flags & E2F_FLAG_TIME_INSANE) &&
+ 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)
@@ -840,7 +846,9 @@ void check_super_block(e2fsck_t ctx)
ext2fs_mark_super_dirty(fs);
}
}
- if (fs->super->s_wtime > (__u32) ctx->now) {
+ if (!broken_system_clock &&
+ !(ctx->flags & E2F_FLAG_TIME_INSANE) &&
+ 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)