afs: Fix key refcounting in file locking code

Fix the refcounting of the authentication keys in the file locking code.
The vnode->lock_key member points to a key on which it expects to be
holding a ref, but it isn't always given an extra ref, however.

Fixes: 0fafdc9f88 ("afs: Fix file locking")
Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
David Howells
2019-01-09 17:23:54 +00:00
parent 4882a27cec
commit 59d49076ae
2 changed files with 4 additions and 2 deletions

View File

@@ -545,6 +545,8 @@ void afs_evict_inode(struct inode *inode)
#endif
afs_put_permits(rcu_access_pointer(vnode->permit_cache));
key_put(vnode->lock_key);
vnode->lock_key = NULL;
_leave("");
}