Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=40d24704091c8a29a4c99d25670f1996749aea6f
Commit:     40d24704091c8a29a4c99d25670f1996749aea6f
Parent:     9e08a3c5aec5b745e844328bcbc16458b6118faf
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 8 09:24:22 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 17:20:47 2007 -0400

    NFS: Fix a connectathon regression in NFSv3 and NFSv4
    
    We're failing basic test6 against Linux servers because they lack a correct
    change attribute. The fix is to assume that we always want to invalidate
    the readdir caches when we call update_changeattr and/or
    nfs_post_op_update_inode on a directory.
    
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 fs/nfs/inode.c    |   10 +++++++++-
 fs/nfs/nfs4proc.c |   10 ++++------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 4693879..c44cd02 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -876,11 +876,19 @@ int nfs_post_op_update_inode(struct inode *inode, struct 
nfs_fattr *fattr)
 {
        struct nfs_inode *nfsi = NFS_I(inode);
 
-       if (fattr->valid & NFS_ATTR_FATTR)
+       if (fattr->valid & NFS_ATTR_FATTR) {
+               if (S_ISDIR(inode->i_mode)) {
+                       spin_lock(&inode->i_lock);
+                       nfsi->cache_validity |= NFS_INO_INVALID_DATA;
+                       spin_unlock(&inode->i_lock);
+               }
                return nfs_refresh_inode(inode, fattr);
+       }
 
        spin_lock(&inode->i_lock);
        nfsi->cache_validity |= 
NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
+       if (S_ISDIR(inode->i_mode))
+               nfsi->cache_validity |= NFS_INO_INVALID_DATA;
        spin_unlock(&inode->i_lock);
        return 0;
 }
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 30d5dd5..cb99fd9 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -208,12 +208,10 @@ static void update_changeattr(struct inode *dir, struct 
nfs4_change_info *cinfo)
        struct nfs_inode *nfsi = NFS_I(dir);
 
        spin_lock(&dir->i_lock);
-       if (cinfo->after != nfsi->change_attr) {
-               nfsi->cache_validity |= 
NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA;
-               if (!cinfo->atomic || cinfo->before != nfsi->change_attr)
-                       nfsi->cache_change_attribute = jiffies;
-               nfsi->change_attr = cinfo->after;
-       }
+       nfsi->cache_validity |= 
NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA;
+       if (!cinfo->atomic || cinfo->before != nfsi->change_attr)
+               nfsi->cache_change_attribute = jiffies;
+       nfsi->change_attr = cinfo->after;
        spin_unlock(&dir->i_lock);
 }
 
-
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