]> err.no Git - linux-2.6/commitdiff
NFS: Fix a connectathon regression in NFSv3 and NFSv4
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 8 Oct 2007 13:24:22 +0000 (09:24 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 9 Oct 2007 21:20:47 +0000 (17:20 -0400)
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 <Trond.Myklebust@netapp.com>
fs/nfs/inode.c
fs/nfs/nfs4proc.c

index 469387920dd987d2cfc04b56f95a9c9131e91cee..c44cd02e51813c400bfd0f52895439f244e3a550 100644 (file)
@@ -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;
 }
index 30d5dd5735cdd93d348c94c7563f14ae39ce6bc3..cb99fd90a9acc5147135bb70846517ad8e79165e 100644 (file)
@@ -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);
 }