diff options
Diffstat (limited to 'fs/9p/vfs_inode.c')
-rw-r--r-- | fs/9p/vfs_inode.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 4331b3b5ee1c..4b3ad6ac9a41 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -896,10 +896,19 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr) | |||
896 | } | 896 | } |
897 | 897 | ||
898 | retval = p9_client_wstat(fid, &wstat); | 898 | retval = p9_client_wstat(fid, &wstat); |
899 | if (retval >= 0) | 899 | if (retval < 0) |
900 | retval = inode_setattr(dentry->d_inode, iattr); | 900 | return retval; |
901 | |||
902 | if ((iattr->ia_valid & ATTR_SIZE) && | ||
903 | iattr->ia_size != i_size_read(dentry->d_inode)) { | ||
904 | retval = vmtruncate(dentry->d_inode, iattr->ia_size); | ||
905 | if (retval) | ||
906 | return retval; | ||
907 | } | ||
901 | 908 | ||
902 | return retval; | 909 | setattr_copy(dentry->d_inode, iattr); |
910 | mark_inode_dirty(dentry->d_inode); | ||
911 | return 0; | ||
903 | } | 912 | } |
904 | 913 | ||
905 | /** | 914 | /** |