]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ceph: fix fscache invalidation
authorJeff Layton <jlayton@kernel.org>
Thu, 21 Jan 2021 23:05:37 +0000 (18:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:57:42 +0000 (10:57 +0200)
[ Upstream commit 10a7052c7868bc7bc72d947f5aac6f768928db87 ]

Ensure that we invalidate the fscache whenever we invalidate the
pagecache.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/caps.c
fs/ceph/inode.c

index 382cf85fd574a11db61cf2feb8cf35366d91ea3f..b077b9a6bf953993a0989849047f0d1b3dca561e 100644 (file)
@@ -1662,6 +1662,7 @@ static int try_nonblocking_invalidate(struct inode *inode)
        u32 invalidating_gen = ci->i_rdcache_gen;
 
        spin_unlock(&ci->i_ceph_lock);
+       ceph_fscache_invalidate(inode);
        invalidate_mapping_pages(&inode->i_data, 0, -1);
        spin_lock(&ci->i_ceph_lock);
 
index 5999d806de78813f9120cac1dc1e323ca60849a2..90db2cd07840e865b9a80e5859c3cf836fbcc9bd 100644 (file)
@@ -1757,6 +1757,7 @@ static void ceph_invalidate_work(struct work_struct *work)
        orig_gen = ci->i_rdcache_gen;
        spin_unlock(&ci->i_ceph_lock);
 
+       ceph_fscache_invalidate(inode);
        if (invalidate_inode_pages2(inode->i_mapping) < 0) {
                pr_err("invalidate_pages %p fails\n", inode);
        }