NFSv4: Update the attribute cache info in update_changeattr
[platform/kernel/linux-rpi.git] / fs / nfs / nfs4proc.c
index d33242c..39dfba9 100644 (file)
@@ -1089,8 +1089,15 @@ static void update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo)
 
        spin_lock(&dir->i_lock);
        nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA;
-       if (!cinfo->atomic || cinfo->before != dir->i_version)
+       if (cinfo->atomic && cinfo->before == dir->i_version) {
+               nfsi->cache_validity &= ~NFS_INO_REVAL_PAGECACHE;
+               nfsi->attrtimeo_timestamp = jiffies;
+       } else {
                nfs_force_lookup_revalidate(dir);
+               if (cinfo->before != dir->i_version)
+                       nfsi->cache_validity |= NFS_INO_INVALID_ACCESS |
+                               NFS_INO_INVALID_ACL;
+       }
        dir->i_version = cinfo->after;
        nfsi->attr_gencount = nfs_inc_attr_generation_counter();
        nfs_fscache_invalidate(dir);