diff options
Diffstat (limited to 'fs/ext4/fsync.c')
| -rw-r--r-- | fs/ext4/fsync.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index 712f00995390..5508baa11bb6 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c | |||
| @@ -116,16 +116,8 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) | |||
| 116 | goto out; | 116 | goto out; |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | ret = file_write_and_wait_range(file, start, end); | ||
| 120 | if (ret) | ||
| 121 | return ret; | ||
| 122 | |||
| 123 | if (!journal) { | 119 | if (!journal) { |
| 124 | struct writeback_control wbc = { | 120 | ret = __generic_file_fsync(file, start, end, datasync); |
| 125 | .sync_mode = WB_SYNC_ALL | ||
| 126 | }; | ||
| 127 | |||
| 128 | ret = ext4_write_inode(inode, &wbc); | ||
| 129 | if (!ret) | 121 | if (!ret) |
| 130 | ret = ext4_sync_parent(inode); | 122 | ret = ext4_sync_parent(inode); |
| 131 | if (test_opt(inode->i_sb, BARRIER)) | 123 | if (test_opt(inode->i_sb, BARRIER)) |
| @@ -133,6 +125,9 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) | |||
| 133 | goto out; | 125 | goto out; |
| 134 | } | 126 | } |
| 135 | 127 | ||
| 128 | ret = file_write_and_wait_range(file, start, end); | ||
| 129 | if (ret) | ||
| 130 | return ret; | ||
| 136 | /* | 131 | /* |
| 137 | * data=writeback,ordered: | 132 | * data=writeback,ordered: |
| 138 | * The caller's filemap_fdatawrite()/wait will sync the data. | 133 | * The caller's filemap_fdatawrite()/wait will sync the data. |
