diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-11-23 07:24:57 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-11-23 07:24:57 -0500 |
commit | 6b17d902fdd241adfa4ce780df20547b28bf5801 (patch) | |
tree | a5daca03108c565c58347d36b1dec70cf22ef1d1 /fs/ext4/fsync.c | |
parent | 1032988c71f3f85483b2b4319684d1205a704c02 (diff) |
ext4: avoid issuing unnecessary barriers
We don't to issue an I/O barrier on an error or if we force commit
because we are doing data journaling.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>
Cc: stable@kernel.org
Diffstat (limited to 'fs/ext4/fsync.c')
-rw-r--r-- | fs/ext4/fsync.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index 2b1531266ee2..a3c25076aef1 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c | |||
@@ -60,7 +60,7 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync) | |||
60 | 60 | ||
61 | ret = flush_aio_dio_completed_IO(inode); | 61 | ret = flush_aio_dio_completed_IO(inode); |
62 | if (ret < 0) | 62 | if (ret < 0) |
63 | goto out; | 63 | return ret; |
64 | /* | 64 | /* |
65 | * data=writeback: | 65 | * data=writeback: |
66 | * The caller's filemap_fdatawrite()/wait will sync the data. | 66 | * The caller's filemap_fdatawrite()/wait will sync the data. |
@@ -79,10 +79,8 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync) | |||
79 | * (they were dirtied by commit). But that's OK - the blocks are | 79 | * (they were dirtied by commit). But that's OK - the blocks are |
80 | * safe in-journal, which is all fsync() needs to ensure. | 80 | * safe in-journal, which is all fsync() needs to ensure. |
81 | */ | 81 | */ |
82 | if (ext4_should_journal_data(inode)) { | 82 | if (ext4_should_journal_data(inode)) |
83 | ret = ext4_force_commit(inode->i_sb); | 83 | return ext4_force_commit(inode->i_sb); |
84 | goto out; | ||
85 | } | ||
86 | 84 | ||
87 | if (!journal) | 85 | if (!journal) |
88 | ret = sync_mapping_buffers(inode->i_mapping); | 86 | ret = sync_mapping_buffers(inode->i_mapping); |