diff options
Diffstat (limited to 'fs/ext3/super.c')
-rw-r--r-- | fs/ext3/super.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 72743d360509..427496c4767c 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -466,6 +466,8 @@ static struct inode *ext3_alloc_inode(struct super_block *sb) | |||
466 | return NULL; | 466 | return NULL; |
467 | ei->i_block_alloc_info = NULL; | 467 | ei->i_block_alloc_info = NULL; |
468 | ei->vfs_inode.i_version = 1; | 468 | ei->vfs_inode.i_version = 1; |
469 | atomic_set(&ei->i_datasync_tid, 0); | ||
470 | atomic_set(&ei->i_sync_tid, 0); | ||
469 | return &ei->vfs_inode; | 471 | return &ei->vfs_inode; |
470 | } | 472 | } |
471 | 473 | ||
@@ -2321,7 +2323,18 @@ static int ext3_commit_super(struct super_block *sb, | |||
2321 | 2323 | ||
2322 | if (!sbh) | 2324 | if (!sbh) |
2323 | return error; | 2325 | return error; |
2324 | es->s_wtime = cpu_to_le32(get_seconds()); | 2326 | /* |
2327 | * If the file system is mounted read-only, don't update the | ||
2328 | * superblock write time. This avoids updating the superblock | ||
2329 | * write time when we are mounting the root file system | ||
2330 | * read/only but we need to replay the journal; at that point, | ||
2331 | * for people who are east of GMT and who make their clock | ||
2332 | * tick in localtime for Windows bug-for-bug compatibility, | ||
2333 | * the clock is set in the future, and this will cause e2fsck | ||
2334 | * to complain and force a full file system check. | ||
2335 | */ | ||
2336 | if (!(sb->s_flags & MS_RDONLY)) | ||
2337 | es->s_wtime = cpu_to_le32(get_seconds()); | ||
2325 | es->s_free_blocks_count = cpu_to_le32(ext3_count_free_blocks(sb)); | 2338 | es->s_free_blocks_count = cpu_to_le32(ext3_count_free_blocks(sb)); |
2326 | es->s_free_inodes_count = cpu_to_le32(ext3_count_free_inodes(sb)); | 2339 | es->s_free_inodes_count = cpu_to_le32(ext3_count_free_inodes(sb)); |
2327 | BUFFER_TRACE(sbh, "marking dirty"); | 2340 | BUFFER_TRACE(sbh, "marking dirty"); |