aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext4/fsync.c8
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);