From 697e03ba1702cd13965c9020884e53b4c9a44f12 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 10 Sep 2009 17:31:04 -0400 Subject: [PATCH] --- yaml --- r: 163679 b: refs/heads/master c: 71290b368ad5e1e0b0b300c9d5638490a9fd1a2d h: refs/heads/master i: 163677: 56684fd5bcba9d315e8bae6fd30a1ccb0b2977fa 163675: 42060d545b26d6bcde4e2dd4e2c4fa3387d07249 163671: f019b034286ecfc0d1b66e28a91caf6d44e1e478 163663: 23b5ef92c272efdfd92e25eca4d74c72d7f180ca 163647: 1a0cb8e2c0f7516813838bcedac8133de69b7104 v: v3 --- [refs] | 2 +- trunk/fs/ext4/super.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index a6a5dfaedc74..24bc5b062d77 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 08c3a8133810d955d97f7146c50c43e4073f2148 +refs/heads/master: 71290b368ad5e1e0b0b300c9d5638490a9fd1a2d diff --git a/trunk/fs/ext4/super.c b/trunk/fs/ext4/super.c index f1815d3bcfd5..9f6fa3f74629 100644 --- a/trunk/fs/ext4/super.c +++ b/trunk/fs/ext4/super.c @@ -3222,7 +3222,18 @@ static int ext4_commit_super(struct super_block *sb, int sync) clear_buffer_write_io_error(sbh); set_buffer_uptodate(sbh); } - es->s_wtime = cpu_to_le32(get_seconds()); + /* + * If the file system is mounted read-only, don't update the + * superblock write time. This avoids updating the superblock + * write time when we are mounting the root file system + * read/only but we need to replay the journal; at that point, + * for people who are east of GMT and who make their clock + * tick in localtime for Windows bug-for-bug compatibility, + * the clock is set in the future, and this will cause e2fsck + * to complain and force a full file system check. + */ + if (!(sb->s_flags & MS_RDONLY)) + es->s_wtime = cpu_to_le32(get_seconds()); es->s_kbytes_written = cpu_to_le64(EXT4_SB(sb)->s_kbytes_written + ((part_stat_read(sb->s_bdev->bd_part, sectors[1]) -