Merge tag 'nfs-for-4.17-1' of git://git.linux-nfs.org/projects/anna/linux-nfs
[sfrench/cifs-2.6.git] / fs / nfs / write.c
index 6579f3b367bdad8107340fdbbec32e439afd079d..0193053bc139d3228602d589dbb643206e970dba 100644 (file)
@@ -231,6 +231,7 @@ static void nfs_grow_file(struct page *page, unsigned int offset, unsigned int c
        if (i_size >= end)
                goto out;
        i_size_write(inode, end);
+       NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_SIZE;
        nfs_inc_stats(inode, NFSIOS_EXTENDWRITE);
 out:
        spin_unlock(&inode->i_lock);
@@ -1562,8 +1563,11 @@ static int nfs_writeback_done(struct rpc_task *task,
        }
 
        /* Deal with the suid/sgid bit corner case */
-       if (nfs_should_remove_suid(inode))
-               nfs_mark_for_revalidate(inode);
+       if (nfs_should_remove_suid(inode)) {
+               spin_lock(&inode->i_lock);
+               NFS_I(inode)->cache_validity |= NFS_INO_INVALID_OTHER;
+               spin_unlock(&inode->i_lock);
+       }
        return 0;
 }