fs/9p: mark inode attribute invalid on rename, unlink and setattr
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 28 Feb 2011 11:34:07 +0000 (17:04 +0530)
committerEric Van Hensbergen <ericvh@gmail.com>
Tue, 15 Mar 2011 14:57:41 +0000 (09:57 -0500)
rename, unlink and setattr can result in update of inode attribute.
So mark the cached copy invalid

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>
fs/9p/vfs_inode.c
fs/9p/vfs_inode_dotl.c

index a28fe9fa20a4d359e176d1ceafd4278428981f94..3e3ffe3ad1a0ea3b058a493c9b4985551139a5dd 100644 (file)
@@ -521,6 +521,7 @@ static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir)
                        drop_nlink(dir);
                } else
                        drop_nlink(file_inode);
+               v9fs_invalidate_inode_attr(file_inode);
        }
        return retval;
 }
@@ -884,6 +885,8 @@ clunk_newdir:
                                inc_nlink(new_dir);
                        drop_nlink(old_dir);
                }
+               v9fs_invalidate_inode_attr(old_inode);
+
                /* successful rename */
                d_move(old_dentry, new_dentry);
        }
@@ -983,6 +986,7 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr)
        if (retval < 0)
                return retval;
 
+       v9fs_invalidate_inode_attr(dentry->d_inode);
        if ((iattr->ia_valid & ATTR_SIZE) &&
            iattr->ia_size != i_size_read(dentry->d_inode)) {
                retval = vmtruncate(dentry->d_inode, iattr->ia_size);
index 5c04d66afb1d96cf6a4d2485a20190ec7d52fdba..8d5f7e32863132daa4e600003280745e55c05326 100644 (file)
@@ -455,6 +455,7 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
        if (retval < 0)
                return retval;
 
+       v9fs_invalidate_inode_attr(dentry->d_inode);
        if ((iattr->ia_valid & ATTR_SIZE) &&
            iattr->ia_size != i_size_read(dentry->d_inode)) {
                retval = vmtruncate(dentry->d_inode, iattr->ia_size);