NFS: Set NFS_INO_REVAL_PAGECACHE if the change attribute is uninitialised
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 5 Jul 2015 20:07:04 +0000 (16:07 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 22 Jul 2015 21:15:53 +0000 (17:15 -0400)
We can't allow caching of data until the change attribute has been
initialised correctly.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/inode.c

index d654661defb39059826a80c2c27c9a0fd131f0d0..426e4f8207ef14b18044888328262fcd2595045a 100644 (file)
@@ -443,7 +443,8 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr, st
                if (fattr->valid & NFS_ATTR_FATTR_CHANGE)
                        inode->i_version = fattr->change_attr;
                else if (nfs_server_capable(inode, NFS_CAP_CHANGE_ATTR))
-                       nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATTR);
+                       nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATTR
+                               | NFS_INO_REVAL_PAGECACHE);
                if (fattr->valid & NFS_ATTR_FATTR_SIZE)
                        inode->i_size = nfs_size_to_loff_t(fattr->size);
                else