aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_inode_dotl.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-02-28 06:34:10 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2011-03-15 10:57:42 -0400
commitf10fc50f1adaf40fdd5da6dd154ecb464b468e2f (patch)
tree254b9ea1aebb08b1bae37557aa7f7ea39b78d05c /fs/9p/vfs_inode_dotl.c
parentc06c066a083aa0a336d6b2b1ed502dd0b8488ac7 (diff)
fs/9p: call vmtruncate before setattr 9p opeation
We need to call vmtruncate before 9p setattr operation, otherwise we could write back some dirty pages between setattr with ATTR_SIZE and vmtruncate causing some truncated pages to be written back to server Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p/vfs_inode_dotl.c')
-rw-r--r--fs/9p/vfs_inode_dotl.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 81bb4c2a0b82..bcd0ee2e549a 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -453,17 +453,16 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
453 if (IS_ERR(fid)) 453 if (IS_ERR(fid))
454 return PTR_ERR(fid); 454 return PTR_ERR(fid);
455 455
456 retval = p9_client_setattr(fid, &p9attr);
457 if (retval < 0)
458 return retval;
459
460 v9fs_invalidate_inode_attr(dentry->d_inode);
461 if ((iattr->ia_valid & ATTR_SIZE) && 456 if ((iattr->ia_valid & ATTR_SIZE) &&
462 iattr->ia_size != i_size_read(dentry->d_inode)) { 457 iattr->ia_size != i_size_read(dentry->d_inode)) {
463 retval = vmtruncate(dentry->d_inode, iattr->ia_size); 458 retval = vmtruncate(dentry->d_inode, iattr->ia_size);
464 if (retval) 459 if (retval)
465 return retval; 460 return retval;
466 } 461 }
462 retval = p9_client_setattr(fid, &p9attr);
463 if (retval < 0)
464 return retval;
465 v9fs_invalidate_inode_attr(dentry->d_inode);
467 466
468 setattr_copy(dentry->d_inode, iattr); 467 setattr_copy(dentry->d_inode, iattr);
469 mark_inode_dirty(dentry->d_inode); 468 mark_inode_dirty(dentry->d_inode);