]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs: dlm: fix mismatch of plock results from userspace
authorAlexander Aring <aahringo@redhat.com>
Wed, 24 May 2023 16:02:04 +0000 (12:02 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2023 14:18:11 +0000 (16:18 +0200)
commitd1d0b239f97432402bb470e58717acd07dad98a4
tree10aac01e0b578dcce10c973e05ba76b29d0d8fc7
parent77d334c446812e17236b32aca35322d674f2165d
fs: dlm: fix mismatch of plock results from userspace

[ Upstream commit 57e2c2f2d94cfd551af91cedfa1af6d972487197 ]

When a waiting plock request (F_SETLKW) is sent to userspace
for processing (dlm_controld), the result is returned at a
later time. That result could be incorrectly matched to a
different waiting request in cases where the owner field is
the same (e.g. different threads in a process.) This is fixed
by comparing all the properties in the request and reply.

The results for non-waiting plock requests are now matched
based on list order because the results are returned in the
same order they were sent.

Cc: stable@vger.kernel.org
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/dlm/plock.c