aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3/inode.c')
-rw-r--r--fs/ext3/inode.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 5c6f07eefa4..b04d1193668 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -3208,9 +3208,17 @@ int ext3_setattr(struct dentry *dentry, struct iattr *attr)
3208 ext3_journal_stop(handle); 3208 ext3_journal_stop(handle);
3209 } 3209 }
3210 3210
3211 rc = inode_setattr(inode, attr); 3211 if ((attr->ia_valid & ATTR_SIZE) &&
3212 attr->ia_size != i_size_read(inode)) {
3213 rc = vmtruncate(inode, attr->ia_size);
3214 if (rc)
3215 goto err_out;
3216 }
3217
3218 setattr_copy(inode, attr);
3219 mark_inode_dirty(inode);
3212 3220
3213 if (!rc && (ia_valid & ATTR_MODE)) 3221 if (ia_valid & ATTR_MODE)
3214 rc = ext3_acl_chmod(inode); 3222 rc = ext3_acl_chmod(inode);
3215 3223
3216err_out: 3224err_out: