aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/hostfs/hostfs_kern.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 9e45f65241ee..3c423c746b59 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -848,9 +848,11 @@ int hostfs_setattr(struct dentry *dentry, struct iattr *attr)
848 attr->ia_size != i_size_read(inode)) { 848 attr->ia_size != i_size_read(inode)) {
849 int error; 849 int error;
850 850
851 error = vmtruncate(inode, attr->ia_size); 851 error = inode_newsize_ok(inode, attr->ia_size);
852 if (err) 852 if (error)
853 return err; 853 return error;
854
855 truncate_setsize(inode, attr->ia_size);
854 } 856 }
855 857
856 setattr_copy(inode, attr); 858 setattr_copy(inode, attr);