diff options
author | Jan Kara <jack@suse.cz> | 2009-10-16 13:26:15 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2009-11-11 09:22:49 -0500 |
commit | fe8bc91c4c30122b357d197117705cfd4fabaf28 (patch) | |
tree | 33e2895847d812204209444db4093af9a2c3623d /fs/ext3/super.c | |
parent | ea0174a7137c8ca9f130ca681f3a99c872da6778 (diff) |
ext3: Wait for proper transaction commit on fsync
We cannot rely on buffer dirty bits during fsync because pdflush can come
before fsync is called and clear dirty bits without forcing a transaction
commit. What we do is that we track which transaction has last changed
the inode and which transaction last changed allocation and force it to
disk on fsync.
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'fs/ext3/super.c')
-rw-r--r-- | fs/ext3/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 7a520a862f49..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 | ||