dlm: fix plock lookup when using multiple lockspaces
authorAlexander Aring <aahringo@redhat.com>
Thu, 24 Aug 2023 20:51:42 +0000 (16:51 -0400)
committerDavid Teigland <teigland@redhat.com>
Fri, 25 Aug 2023 15:31:39 +0000 (10:31 -0500)
commit7c53e847ff5e97f033fdd31f71949807633d506b
tree4fd8daa6023a515e4969a3f03b94d0dfeb580287
parenta3d85fcf268ea40c024e864b219b72516236d15b
dlm: fix plock lookup when using multiple lockspaces

All posix lock ops, for all lockspaces (gfs2 file systems) are
sent to userspace (dlm_controld) through a single misc device.
The dlm_controld daemon reads the ops from the misc device
and sends them to other cluster nodes using separate, per-lockspace
cluster api communication channels.  The ops for a single lockspace
are ordered at this level, so that the results are received in
the same sequence that the requests were sent.  When the results
are sent back to the kernel via the misc device, they are again
funneled through the single misc device for all lockspaces.  When
the dlm code in the kernel processes the results from the misc
device, these results will be returned in the same sequence that
the requests were sent, on a per-lockspace basis.  A recent change
in this request/reply matching code missed the "per-lockspace"
check (fsid comparison) when matching request and reply, so replies
could be incorrectly matched to requests from other lockspaces.

Cc: stable@vger.kernel.org
Reported-by: Barry Marson <bmarson@redhat.com>
Fixes: 57e2c2f2d94c ("fs: dlm: fix mismatch of plock results from userspace")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/plock.c