diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-26 13:06:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-26 13:06:29 -0400 |
commit | 9798a22df3a8a976932838b6375c064fc9e623e1 (patch) | |
tree | e577d13f6e8c06c33b1dedd9d316124bf30d0bf2 | |
parent | a3ac7917b73070010c05b4485b8582a6c9cd69b6 (diff) | |
parent | 945ab8f6de94430c23a82f3cf2e3f6d6f2945ff7 (diff) |
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.c | 5 |
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, | |||
1160 | */ | 1160 | */ |
1161 | error = -EDEADLK; | 1161 | error = -EDEADLK; |
1162 | spin_lock(&blocked_lock_lock); | 1162 | spin_lock(&blocked_lock_lock); |
1163 | /* | ||
1164 | * Ensure that we don't find any locks blocked on this | ||
1165 | * request during deadlock detection. | ||
1166 | */ | ||
1167 | __locks_wake_up_blocks(request); | ||
1163 | if (likely(!posix_locks_deadlock(request, fl))) { | 1168 | if (likely(!posix_locks_deadlock(request, fl))) { |
1164 | error = FILE_LOCK_DEFERRED; | 1169 | error = FILE_LOCK_DEFERRED; |
1165 | __locks_insert_block(fl, request, | 1170 | __locks_insert_block(fl, request, |