diff options
author | Trond Myklebust <[email protected]> | 2006-10-21 10:24:24 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2006-10-21 13:35:06 -0700 |
commit | fc22617e451f23b466d4d63bb016f5f6111b69e4 (patch) | |
tree | 64a772622e9bcd49f23ffcde408eb3517082ce6f | |
parent | 9eaef27b36a6b716384948da94b8fc5bfba7b712 (diff) |
[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: Trond Myklebust <[email protected]>
Cc: Miklos Szeredi <[email protected]>
Cc: Maneesh Soni <[email protected]>
Cc: Dipankar Sarma <[email protected]>
Cc: Neil Brown <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | fs/nfs/dir.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 27b5a1051b1c..b34cd16f472f 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -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); |