afs: Fix key refcounting in file locking code
authorDavid Howells <dhowells@redhat.com>
Wed, 9 Jan 2019 17:23:54 +0000 (17:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:08:56 +0000 (10:08 +0100)
commit5d6af6f9dd2f99381b147431e30a72fbd625fe70
tree7a844002caa3d40147263bbde930d439cccb8f40
parentdc4ec1bad9e2dfc6308c7c53f95f491b22cef897
afs: Fix key refcounting in file locking code

[ Upstream commit 59d49076ae3e6912e6d7df2fd68e2337f3d02036 ]

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: 0fafdc9f888b ("afs: Fix file locking")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/afs/flock.c
fs/afs/inode.c