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.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 364105291282..17947dc8341e 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -997,10 +997,9 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
997 } 997 }
998 998
999 if (size_change && attr->ia_size != i_size_read(inode)) { 999 if (size_change && attr->ia_size != i_size_read(inode)) {
1000 if (attr->ia_size > sb->s_maxbytes) { 1000 status = inode_newsize_ok(inode, attr->ia_size);
1001 status = -EFBIG; 1001 if (status)
1002 goto bail_unlock; 1002 goto bail_unlock;
1003 }
1004 1003
1005 if (i_size_read(inode) > attr->ia_size) { 1004 if (i_size_read(inode) > attr->ia_size) {
1006 if (ocfs2_should_order_data(inode)) { 1005 if (ocfs2_should_order_data(inode)) {
@@ -1840,6 +1839,8 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
1840 &meta_level); 1839 &meta_level);
1841 if (has_refcount) 1840 if (has_refcount)
1842 *has_refcount = 1; 1841 *has_refcount = 1;
1842 if (direct_io)
1843 *direct_io = 0;
1843 } 1844 }
1844 1845
1845 if (ret < 0) { 1846 if (ret < 0) {
@@ -1863,10 +1864,6 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
1863 break; 1864 break;
1864 } 1865 }
1865 1866
1866 if (has_refcount && *has_refcount == 1) {
1867 *direct_io = 0;
1868 break;
1869 }
1870 /* 1867 /*
1871 * Allowing concurrent direct writes means 1868 * Allowing concurrent direct writes means
1872 * i_size changes wouldn't be synchronized, so 1869 * i_size changes wouldn't be synchronized, so
@@ -2047,7 +2044,7 @@ out_dio:
2047 * async dio is going to do it in the future or an end_io after an 2044 * async dio is going to do it in the future or an end_io after an
2048 * error has already done it. 2045 * error has already done it.
2049 */ 2046 */
2050 if (ret == -EIOCBQUEUED || !ocfs2_iocb_is_rw_locked(iocb)) { 2047 if ((ret == -EIOCBQUEUED) || (!ocfs2_iocb_is_rw_locked(iocb))) {
2051 rw_level = -1; 2048 rw_level = -1;
2052 have_alloc_sem = 0; 2049 have_alloc_sem = 0;
2053 } 2050 }