aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysv/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysv/file.c')
-rw-r--r--fs/sysv/file.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/sysv/file.c b/fs/sysv/file.c
index 94f6319292a1..0a65939508e9 100644
--- a/fs/sysv/file.c
+++ b/fs/sysv/file.c
@@ -38,7 +38,17 @@ static int sysv_setattr(struct dentry *dentry, struct iattr *attr)
38 error = inode_change_ok(inode, attr); 38 error = inode_change_ok(inode, attr);
39 if (error) 39 if (error)
40 return error; 40 return error;
41 return inode_setattr(inode, attr); 41
42 if ((attr->ia_valid & ATTR_SIZE) &&
43 attr->ia_size != i_size_read(inode)) {
44 error = vmtruncate(inode, attr->ia_size);
45 if (error)
46 return error;
47 }
48
49 setattr_copy(inode, attr);
50 mark_inode_dirty(inode);
51 return 0;
42} 52}
43 53
44const struct inode_operations sysv_file_inode_operations = { 54const struct inode_operations sysv_file_inode_operations = {