ext4: 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> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
@ -709,6 +709,13 @@ struct ext4_inode_info {
|
||||
struct list_head i_aio_dio_complete_list;
|
||||
/* current io_end structure for async DIO write*/
|
||||
ext4_io_end_t *cur_aio_dio;
|
||||
|
||||
/*
|
||||
* Transactions that contain inode's metadata needed to complete
|
||||
* fsync and fdatasync, respectively.
|
||||
*/
|
||||
tid_t i_sync_tid;
|
||||
tid_t i_datasync_tid;
|
||||
};
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user