diff options
-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 d97c34a24f7a..c7c23eab9440 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -1263,10 +1263,19 @@ static int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr) | |||
1263 | return PTR_ERR(fid); | 1263 | return PTR_ERR(fid); |
1264 | 1264 | ||
1265 | retval = p9_client_setattr(fid, &p9attr); | 1265 | retval = p9_client_setattr(fid, &p9attr); |
1266 | if (retval >= 0) | 1266 | if (retval < 0) |
1267 | retval = inode_setattr(dentry->d_inode, iattr); | 1267 | return retval; |
1268 | 1268 | ||
1269 | return retval; | 1269 | if ((iattr->ia_valid & ATTR_SIZE) && |
1270 | iattr->ia_size != i_size_read(dentry->d_inode)) { | ||
1271 | retval = vmtruncate(dentry->d_inode, iattr->ia_size); | ||
1272 | if (retval) | ||
1273 | return retval; | ||
1274 | } | ||
1275 | |||
1276 | setattr_copy(dentry->d_inode, iattr); | ||
1277 | mark_inode_dirty(dentry->d_inode); | ||
1278 | return 0; | ||
1270 | } | 1279 | } |
1271 | 1280 | ||
1272 | /** | 1281 | /** |