Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=57fa76f2da05d0fee597b26bbc1f05242252beab
Commit:     57fa76f2da05d0fee597b26bbc1f05242252beab
Parent:     47aabaa7e45385fee4a535a6f6e523ff944e1684
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Sun Sep 30 18:01:13 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 17:19:00 2007 -0400

    NFS: Don't use readdirplus data if the page cache is invalid
    
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 fs/nfs/dir.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 6518b09..9f8ec3c 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)
                .len = entry->len,
        };
        struct inode *inode;
+       unsigned long verf = nfs_save_change_attribute(dir);
 
        switch (name.len) {
                case 2:
@@ -1120,6 +1121,14 @@ static struct dentry 
*nfs_readdir_lookup(nfs_readdir_descriptor_t *desc)
                        if (name.name[0] == '.')
                                return dget(parent);
        }
+
+       spin_lock(&dir->i_lock);
+       if (NFS_I(dir)->cache_validity & NFS_INO_INVALID_DATA) {
+               spin_unlock(&dir->i_lock);
+               return NULL;
+       }
+       spin_unlock(&dir->i_lock);
+
        name.hash = full_name_hash(name.name, name.len);
        dentry = d_lookup(parent, &name);
        if (dentry != NULL) {
@@ -1161,7 +1170,7 @@ static struct dentry 
*nfs_readdir_lookup(nfs_readdir_descriptor_t *desc)
        }
 
 out_renew:
-       nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
+       nfs_set_verifier(dentry, verf);
        return dentry;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to