aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hfsplus')
-rw-r--r--fs/hfsplus/inode.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index d6ebe53fbdbf..654c5a8ddf1c 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -298,7 +298,17 @@ static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr)
298 error = inode_change_ok(inode, attr); 298 error = inode_change_ok(inode, attr);
299 if (error) 299 if (error)
300 return error; 300 return error;
301 return inode_setattr(inode, attr); 301
302 if ((attr->ia_valid & ATTR_SIZE) &&
303 attr->ia_size != i_size_read(inode)) {
304 error = vmtruncate(inode, attr->ia_size);
305 if (error)
306 return error;
307 }
308
309 setattr_copy(inode, attr);
310 mark_inode_dirty(inode);
311 return 0;
302} 312}
303 313
304static const struct inode_operations hfsplus_file_inode_operations = { 314static const struct inode_operations hfsplus_file_inode_operations = {