+2005-09-24 Theodore Ts'o <tytso@mit.edu>
+
+ * super.c (check_super_block), problem.c, problem.h: Detect if the
+ superblock's last mount field or last write field is in
+ the future, and offer to fix if so. (Addresses Debian Bug
+ #327580)
+
2005-07-25 Theodore Ts'o <tytso@mit.edu>
* unix.c (main): Fix a use-after-free bug of the e2fsck context
fatal_error(ctx, 0);
}
ctx->fs->priv_data = ctx;
+ ctx->fs->now = ctx->now;
/* Set the superblock flags */
e2fsck_clear_recover(ctx, recover_retval);
N_("Resize @i not valid. "),
PROMPT_RECREATE, 0 },
+ /* Last mount time is in the future */
+ { PR_0_FUTURE_SB_LAST_MOUNT,
+ N_("@S last mount time is in the future. "),
+ PROMPT_FIX, 0 },
+
+ /* Last write time is in the future */
+ { PR_0_FUTURE_SB_LAST_WRITE,
+ N_("@S last write time is in the future. "),
+ PROMPT_FIX, 0 },
+
/* Pass 1 errors */
/* Pass 1: Checking inodes, blocks, and sizes */
/* Resize inode invalid */
#define PR_0_RESIZE_INODE_INVALID 0x000030
+/* Last mount time is in the future */
+#define PR_0_FUTURE_SB_LAST_MOUNT 0x000031
+
+/* Last write time is in the future */
+#define PR_0_FUTURE_SB_LAST_WRITE 0x000032
+
/*
* Pass 1 errors
*/
ext2fs_mark_super_dirty(fs);
}
+ /*
+ * Check to see if the superblock last mount time or last
+ * write time is in the future.
+ */
+ if (fs->super->s_mtime > ctx->now) {
+ pctx.num = fs->super->s_mtime;
+ if (fix_problem(ctx, PR_0_FUTURE_SB_LAST_MOUNT, &pctx)) {
+ fs->super->s_mtime = ctx->now;
+ ext2fs_mark_super_dirty(fs);
+ }
+ }
+ if (fs->super->s_wtime > ctx->now) {
+ pctx.num = fs->super->s_wtime;
+ if (fix_problem(ctx, PR_0_FUTURE_SB_LAST_WRITE, &pctx)) {
+ fs->super->s_wtime = ctx->now;
+ ext2fs_mark_super_dirty(fs);
+ }
+ }
+
/*
* Move the ext3 journal file, if necessary.
*/
}
ctx->fs = fs;
fs->priv_data = ctx;
+ fs->now = ctx->now;
sb = fs->super;
if (sb->s_rev_level > E2FSCK_CURRENT_REV) {
com_err(ctx->program_name, EXT2_ET_REV_TOO_HIGH,
+2005-09-24 Theodore Ts'o <tytso@mit.edu>
+
+ * f_dup_resize: Set the current time to in debugfs to a value
+ which avoids triggering the "s_mtime in the future"
+ warning from e2fsck.
+
2005-08-08 Theodore Ts'o <tytso@mit.edu>
* test_config, test_script.in, d_loaddump, f_dup_resize,
freeb 4 4
freeb 8195 4
write $TEST_DATA debugfs
+set_current_time 200504110000
set_inode_field debugfs mtime 200504110000
q
EOF