Skip to content

Commit 14786d9

Browse files
jtlaytonbrauner
authored andcommitted
filelock: fix deadlock detection in POSIX locking
The FL_POSIX check in __locks_insert_block was inadvertantly broken recently and is now inserting only OFD locks instead of only legacy POSIX locks. This breaks deadlock detection in POSIX locks, and may also be the root cause of a performance regression noted by the kernel test robot. Restore the proper sense of the test. Fixes: b6be371 ("filelock: convert __locks_insert_block, conflict and deadlock checks to use file_lock_core") Reported-by: kernel test robot <oliver.sang@intel.com> Closes: https://lore.kernel.org/oe-lkp/202402181229.f8147f40-oliver.sang@intel.com Signed-off-by: Jeff Layton <jlayton@kernel.org> Link: https://lore.kernel.org/r/20240218-flsplit4-v1-1-26454fc090f2@kernel.org Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 582a3bf commit 14786d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/locks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ static void __locks_insert_block(struct file_lock_core *blocker,
812812
list_add_tail(&waiter->flc_blocked_member,
813813
&blocker->flc_blocked_requests);
814814

815-
if ((blocker->flc_flags & (FL_POSIX|FL_OFDLCK)) == (FL_POSIX|FL_OFDLCK))
815+
if ((blocker->flc_flags & (FL_POSIX|FL_OFDLCK)) == FL_POSIX)
816816
locks_insert_global_blocked(waiter);
817817

818818
/* The requests in waiter->flc_blocked are known to conflict with

0 commit comments

Comments
 (0)