From: Trond Myklebust 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 Cc: Miklos Szeredi Cc: Maneesh Soni Cc: Dipankar Sarma Cc: Neil Brown Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton --- fs/nfs/dir.c | 6 ++++++ 1 file changed, 6 insertions(+) diff -puN fs/nfs/dir.c~nfs-cache-invalidation-fixup fs/nfs/dir.c --- a/fs/nfs/dir.c~nfs-cache-invalidation-fixup +++ a/fs/nfs/dir.c @@ -936,8 +936,14 @@ static struct dentry *nfs_lookup(struct 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); _