aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r--fs/ocfs2/file.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 441c6a94059d..c95318bc00cb 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -185,7 +185,7 @@ static int ocfs2_sync_file(struct file *file,
185 goto bail; 185 goto bail;
186 186
187 journal = osb->journal->j_journal; 187 journal = osb->journal->j_journal;
188 err = journal_force_commit(journal); 188 err = jbd2_journal_force_commit(journal);
189 189
190bail: 190bail:
191 mlog_exit(err); 191 mlog_exit(err);
@@ -941,9 +941,15 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
941 goto bail_unlock; 941 goto bail_unlock;
942 } 942 }
943 943
944 if (i_size_read(inode) > attr->ia_size) 944 if (i_size_read(inode) > attr->ia_size) {
945 if (ocfs2_should_order_data(inode)) {
946 status = ocfs2_begin_ordered_truncate(inode,
947 attr->ia_size);
948 if (status)
949 goto bail_unlock;
950 }
945 status = ocfs2_truncate_file(inode, bh, attr->ia_size); 951 status = ocfs2_truncate_file(inode, bh, attr->ia_size);
946 else 952 } else
947 status = ocfs2_extend_file(inode, bh, attr->ia_size); 953 status = ocfs2_extend_file(inode, bh, attr->ia_size);
948 if (status < 0) { 954 if (status < 0) {
949 if (status != -ENOSPC) 955 if (status != -ENOSPC)
@@ -1888,7 +1894,7 @@ out_dio:
1888 */ 1894 */
1889 if (old_size != i_size_read(inode) || 1895 if (old_size != i_size_read(inode) ||
1890 old_clusters != OCFS2_I(inode)->ip_clusters) { 1896 old_clusters != OCFS2_I(inode)->ip_clusters) {
1891 ret = journal_force_commit(osb->journal->j_journal); 1897 ret = jbd2_journal_force_commit(osb->journal->j_journal);
1892 if (ret < 0) 1898 if (ret < 0)
1893 written = ret; 1899 written = ret;
1894 } 1900 }