aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-26 10:06:29 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-26 10:06:29 -0700
commit9798a22df3a8a976932838b6375c064fc9e623e1 (patch)
treee577d13f6e8c06c33b1dedd9d316124bf30d0bf2
parentRevert "parport: daisy: use new parport device model" (diff)
parentlocks: wake any locks blocked on request before deadlock check (diff)
downloadlinux-dev-9798a22df3a8a976932838b6375c064fc9e623e1.tar.xz
linux-dev-9798a22df3a8a976932838b6375c064fc9e623e1.zip
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
-rw-r--r--fs/locks.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/locks.c b/fs/locks.c
index eaa1cfaf73b0..71d0c6c2aac5 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1160,6 +1160,11 @@ static int posix_lock_inode(struct inode *inode, struct file_lock *request,
*/
error = -EDEADLK;
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))) {
error = FILE_LOCK_DEFERRED;
__locks_insert_block(fl, request,