diff options
Diffstat (limited to 'fs/hostfs/hostfs_kern.c')
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 6c9f3a9d5e21..457addc5c91f 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -16,8 +16,8 @@ | |||
16 | #include <linux/mount.h> | 16 | #include <linux/mount.h> |
17 | #include <linux/namei.h> | 17 | #include <linux/namei.h> |
18 | #include "hostfs.h" | 18 | #include "hostfs.h" |
19 | #include "init.h" | 19 | #include <init.h> |
20 | #include "kern.h" | 20 | #include <kern.h> |
21 | 21 | ||
22 | struct hostfs_inode_info { | 22 | struct hostfs_inode_info { |
23 | int fd; | 23 | int fd; |
@@ -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); |