From: Jeff Layton Date: Thu, 21 Jan 2021 23:05:37 +0000 (-0500) Subject: ceph: fix fscache invalidation X-Git-Tag: v5.12.6~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3c63f9317aef56f2b6f4e104bdc18bf50fb7b200;p=thirdparty%2Fkernel%2Fstable.git ceph: fix fscache invalidation [ Upstream commit 10a7052c7868bc7bc72d947f5aac6f768928db87 ] Ensure that we invalidate the fscache whenever we invalidate the pagecache. Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Sasha Levin --- diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 570731c4d019d..d405ba801492f 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -1867,6 +1867,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); diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 156f849f53856..4418d4be2907b 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -1863,6 +1863,7 @@ static void ceph_do_invalidate_pages(struct inode *inode) 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); }