summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2009-10-16 19:26:15 +0200
committerJan Kara <jack@suse.cz>2009-11-11 15:22:49 +0100
commitfe8bc91c4c30122b357d197117705cfd4fabaf28 (patch)
tree33e2895847d812204209444db4093af9a2c3623d /include
parentea0174a7137c8ca9f130ca681f3a99c872da6778 (diff)
downloadlinux-fe8bc91c4c30122b357d197117705cfd4fabaf28.tar.bz2
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 'include')
-rw-r--r--include/linux/ext3_fs_i.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h
index ca1bfe90004f..93e7428156ba 100644
--- a/include/linux/ext3_fs_i.h
+++ b/include/linux/ext3_fs_i.h
@@ -137,6 +137,14 @@ struct ext3_inode_info {
* by other means, so we have truncate_mutex.
*/
struct mutex truncate_mutex;
+
+ /*
+ * Transactions that contain inode's metadata needed to complete
+ * fsync and fdatasync, respectively.
+ */
+ atomic_t i_sync_tid;
+ atomic_t i_datasync_tid;
+
struct inode vfs_inode;
};