Commit fc22617e authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

[PATCH] NFS: Cache invalidation fixup

If someone has renamed a directory on the server, triggering the d_move
code in d_materialise_unique(), then we need to invalidate the cached
directory information in the source parent directory.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Maneesh Soni <maneesh@in.ibm.com>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9eaef27b
...@@ -936,8 +936,14 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru ...@@ -936,8 +936,14 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
no_entry: no_entry:
res = d_materialise_unique(dentry, inode); res = d_materialise_unique(dentry, inode);
if (res != NULL) { if (res != NULL) {
struct dentry *parent;
if (IS_ERR(res)) if (IS_ERR(res))
goto out_unlock; goto out_unlock;
/* Was a directory renamed! */
parent = dget_parent(res);
if (!IS_ROOT(parent))
nfs_mark_for_revalidate(parent->d_inode);
dput(parent);
dentry = res; dentry = res;
} }
nfs_renew_times(dentry); nfs_renew_times(dentry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment