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:40:34 +0000 (10:40 +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 2a351821d8f3201b846486eaffda118f6b2ce8b6..0eb2ada032c747325aec626f9c248e47825f075c 100644 (file)
@@ -1577,6 +1577,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 049cff197d2a11f65507156348eed5986c536312..5e12ea92f7cdbff31ee610bb5ab5b9556da5bf73 100644 (file)
@@ -1762,6 +1762,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);
        }