]> git.baikalelectronics.ru Git - kernel.git/commit
locks: reinstate locks_delete_block optimization
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Mar 2020 11:52:21 +0000 (07:52 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Mar 2020 20:03:38 +0000 (13:03 -0700)
commit39cd3ec9f9c50e9ae29f2b76655dd03aaf7d1181
treebcec3946a19e79751a97280bed14a633ad1a8ff8
parentc9418a085a4bf603c97d5624fb0083d50a35d36f
locks: reinstate locks_delete_block optimization

There is measurable performance impact in some synthetic tests due to
commit c88631651d1b (locks: fix a potential use-after-free problem when
wakeup a waiter). Fix the race condition instead by clearing the
fl_blocker pointer after the wake_up, using explicit acquire/release
semantics.

This does mean that we can no longer use the clearing of fl_blocker as
the wait condition, so switch the waiters over to checking whether the
fl_blocked_member list_head is empty.

Reviewed-by: yangerkun <yangerkun@huawei.com>
Reviewed-by: NeilBrown <neilb@suse.de>
Fixes: c88631651d1b (locks: fix a potential use-after-free problem when wakeup a waiter)
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/cifs/file.c
fs/locks.c