Commit 9798a22d authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'locks-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux

Pull file locking bugfix from Jeff Layton:
 "Just a single fix for a bug that crept into POSIX lock deadlock
  detection in v5.0"

* tag 'locks-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
  locks: wake any locks blocked on request before deadlock check
parents a3ac7917 945ab8f6
...@@ -1160,6 +1160,11 @@ static int posix_lock_inode(struct inode *inode, struct file_lock *request, ...@@ -1160,6 +1160,11 @@ static int posix_lock_inode(struct inode *inode, struct file_lock *request,
*/ */
error = -EDEADLK; error = -EDEADLK;
spin_lock(&blocked_lock_lock); spin_lock(&blocked_lock_lock);
/*
* Ensure that we don't find any locks blocked on this
* request during deadlock detection.
*/
__locks_wake_up_blocks(request);
if (likely(!posix_locks_deadlock(request, fl))) { if (likely(!posix_locks_deadlock(request, fl))) {
error = FILE_LOCK_DEFERRED; error = FILE_LOCK_DEFERRED;
__locks_insert_block(fl, request, __locks_insert_block(fl, request,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment