filelock: fix deadlock detection in POSIX locking
authorJeff Layton <jlayton@kernel.org>
Sun, 18 Feb 2024 13:33:28 +0000 (08:33 -0500)
committerChristian Brauner <brauner@kernel.org>
Tue, 20 Feb 2024 08:53:33 +0000 (09:53 +0100)
commit14786d949a3b8cf00cc32456363b7db22894a0e6
tree01ad61ea133dd50892b29e906d3e19234ff1c840
parent582a3bf999df662c0e0fa4717ce7559f16d7b93b
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: b6be3714005c ("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>
fs/locks.c