summaryrefslogtreecommitdiffstats
path: root/fs/afs/inode.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-05-15 13:09:17 +0200
committerDavid Howells <dhowells@redhat.com>2019-05-15 13:32:34 +0200
commita1b879eefc2b34cd3f17187ef6fc1cf3960e9518 (patch)
tree749a872254c15ad9de5a0e17a895d7d553321e99 /fs/afs/inode.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next (diff)
downloadlinux-a1b879eefc2b34cd3f17187ef6fc1cf3960e9518.tar.xz
linux-a1b879eefc2b34cd3f17187ef6fc1cf3960e9518.zip
afs: Fix key leak in afs_release() and afs_evict_inode()
Fix afs_release() to go through the cleanup part of the function if FMODE_WRITE is set rather than exiting through vfs_fsync() (which skips the cleanup). The cleanup involves discarding the refs on the key used for file ops and the writeback key record. Also fix afs_evict_inode() to clean up any left over wb keys attached to the inode/vnode when it is removed. Fixes: 5a8132761609 ("afs: Do better accretion of small writes on newly created content") Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to '')
-rw-r--r--fs/afs/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index c4652b42d545..f30aa5eacd39 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -573,6 +573,7 @@ void afs_evict_inode(struct inode *inode)
}
#endif
+ afs_prune_wb_keys(vnode);
afs_put_permits(rcu_access_pointer(vnode->permit_cache));
key_put(vnode->silly_key);
vnode->silly_key = NULL;