aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 6518b098e625..9f8ec3c3e6a7 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1110,6 +1110,7 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc)
1110 .len = entry->len, 1110 .len = entry->len,
1111 }; 1111 };
1112 struct inode *inode; 1112 struct inode *inode;
1113 unsigned long verf = nfs_save_change_attribute(dir);
1113 1114
1114 switch (name.len) { 1115 switch (name.len) {
1115 case 2: 1116 case 2:
@@ -1120,6 +1121,14 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc)
1120 if (name.name[0] == '.') 1121 if (name.name[0] == '.')
1121 return dget(parent); 1122 return dget(parent);
1122 } 1123 }
1124
1125 spin_lock(&dir->i_lock);
1126 if (NFS_I(dir)->cache_validity & NFS_INO_INVALID_DATA) {
1127 spin_unlock(&dir->i_lock);
1128 return NULL;
1129 }
1130 spin_unlock(&dir->i_lock);
1131
1123 name.hash = full_name_hash(name.name, name.len); 1132 name.hash = full_name_hash(name.name, name.len);
1124 dentry = d_lookup(parent, &name); 1133 dentry = d_lookup(parent, &name);
1125 if (dentry != NULL) { 1134 if (dentry != NULL) {
@@ -1161,7 +1170,7 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc)
1161 } 1170 }
1162 1171
1163out_renew: 1172out_renew:
1164 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); 1173 nfs_set_verifier(dentry, verf);
1165 return dentry; 1174 return dentry;
1166} 1175}
1167 1176