diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-10-21 13:24:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-21 16:35:06 -0400 |
commit | fc22617e451f23b466d4d63bb016f5f6111b69e4 (patch) | |
tree | 64a772622e9bcd49f23ffcde408eb3517082ce6f /fs/nfs | |
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 <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>
Diffstat (limited to 'fs/nfs')
-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 | |||
936 | no_entry: | 936 | no_entry: |
937 | res = d_materialise_unique(dentry, inode); | 937 | res = d_materialise_unique(dentry, inode); |
938 | if (res != NULL) { | 938 | if (res != NULL) { |
939 | struct dentry *parent; | ||
939 | if (IS_ERR(res)) | 940 | if (IS_ERR(res)) |
940 | goto out_unlock; | 941 | goto out_unlock; |
942 | /* Was a directory renamed! */ | ||
943 | parent = dget_parent(res); | ||
944 | if (!IS_ROOT(parent)) | ||
945 | nfs_mark_for_revalidate(parent->d_inode); | ||
946 | dput(parent); | ||
941 | dentry = res; | 947 | dentry = res; |
942 | } | 948 | } |
943 | nfs_renew_times(dentry); | 949 | nfs_renew_times(dentry); |