summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2010-06-22 11:15:01 +1000
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-11 00:08:00 -0400
commit8cef9c67356eca3e6502444c8075a06c86872abf (patch)
treed98de53b2f22488f898cd200fe341c4355b4a342 /fs
parentb34d8915c413acb51d837a45fb8747b61f65c020 (diff)
v9fs: fixup for inode_setattr being removed
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/9p/vfs_inode.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index d97c34a24f7..c7c23eab944 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)
return PTR_ERR(fid);
retval = p9_client_setattr(fid, &p9attr);
- if (retval >= 0)
- retval = inode_setattr(dentry->d_inode, iattr);
+ if (retval < 0)
+ return retval;
- return retval;
+ if ((iattr->ia_valid & ATTR_SIZE) &&
+ iattr->ia_size != i_size_read(dentry->d_inode)) {
+ retval = vmtruncate(dentry->d_inode, iattr->ia_size);
+ if (retval)
+ return retval;
+ }
+
+ setattr_copy(dentry->d_inode, iattr);
+ mark_inode_dirty(dentry->d_inode);
+ return 0;
}
/**