Skip to content

Commit

Permalink
[PATCH] NFS: Cache invalidation fixup
Browse files Browse the repository at this point in the history
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: Trond 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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Trond Myklebust authored and Linus Torvalds committed Oct 21, 2006
1 parent 9eaef27 commit fc22617
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,14 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
no_entry:
res = d_materialise_unique(dentry, inode);
if (res != NULL) {
struct dentry *parent;
if (IS_ERR(res))
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;
}
nfs_renew_times(dentry);
Expand Down

0 comments on commit fc22617

Please sign in to comment.