afs: Fix lock-wait/callback-break double locking
authorDavid Howells <dhowells@redhat.com>
Fri, 10 May 2019 22:03:31 +0000 (23:03 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 16 May 2019 15:25:21 +0000 (16:25 +0100)
commit37b349ff7e714fef52525f46ae5e0984d4fbcac8
treeffdfd1eb1aa6c2096f4bc371b3347b57427665b9
parent6097b9a9d8a9fdbe11d6a68d352e80756ca03110
afs: Fix lock-wait/callback-break double locking

__afs_break_callback() holds vnode->lock around its call of
afs_lock_may_be_available() - which also takes that lock.

Fix this by not taking the lock in __afs_break_callback().

Also, there's no point checking the granted_locks and pending_locks queues;
it's sufficient to check lock_state, so move that check out of
afs_lock_may_be_available() into __afs_break_callback() to replace the
queue checks.

Fixes: 98233ada0b32 ("AFS: implement file locking")
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/callback.c
fs/afs/flock.c