]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
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)
commitc7226e407b6065d3bda8bd9dc627663d2c505ea3
treeffdfd1eb1aa6c2096f4bc371b3347b57427665b9
parentd9052dda8a39069312218f913d22d99c48d90004
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: e8d6c554126b ("AFS: implement file locking")
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/callback.c
fs/afs/flock.c