If a write extends the size of the file and fscache is enabled, we need to invalidate the object with the new size. Otherwise, the next read from the cache may fail inside cachefiles_shape_extent() due to cookie->zero_point being smaller than the size of the file. Signed-off-by: Dave Wysochanski <dwysocha@xxxxxxxxxx> --- fs/nfs/write.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 005eea29e0ec..2da99814da51 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -290,6 +290,7 @@ static void nfs_grow_file(struct page *page, unsigned int offset, unsigned int c goto out; i_size_write(inode, end); NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_SIZE; + nfs_fscache_invalidate(inode); nfs_inc_stats(inode, NFSIOS_EXTENDWRITE); out: spin_unlock(&inode->i_lock); -- 1.8.3.1