aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-04-04 13:41:25 +0100
committerDavid Howells <dhowells@redhat.com>2018-04-04 13:41:25 +0100
commitc1515999bdf9a91a4b7c82623a068ffe770a17b9 (patch)
tree44a05bf8732e1ee4d8f251fce0b61459814dd57c /fs/afs
parentMerge branch 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace (diff)
downloadlinux-dev-c1515999bdf9a91a4b7c82623a068ffe770a17b9.tar.xz
linux-dev-c1515999bdf9a91a4b7c82623a068ffe770a17b9.zip
afs: Invalidate cache on server data change
Invalidate any data stored in fscache for a vnode that changes on the server so that we don't end up with the cache in a bad state locally. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index 6b39d0255b72..42f83fd5a896 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -343,6 +343,10 @@ void afs_zap_data(struct afs_vnode *vnode)
{
_enter("{%x:%u}", vnode->fid.vid, vnode->fid.vnode);
+#ifdef CONFIG_AFS_FSCACHE
+ fscache_invalidate(vnode->cache);
+#endif
+
/* nuke all the non-dirty pages that aren't locked, mapped or being
* written back in a regular file and completely discard the pages in a
* directory or symlink */