]> git.proxmox.com Git - pve-cluster.git/commit
pmxcfs: protect CPG operations with mutex
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 30 Sep 2020 11:21:31 +0000 (13:21 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 30 Sep 2020 11:26:11 +0000 (13:26 +0200)
commit9dd866204c76fab850d5939018e7d5aa79b1df3c
treef1688df8637c4b7dc69cbf4c86d955b1b4025da0
parent38fde8ccc3b177e882fc91a1141a213e200452a2
pmxcfs: protect CPG operations with mutex

cpg_mcast_joined (and transitively, cpg_join/leave) are not thread-safe.
pmxcfs triggers such operations via FUSE and CPG dispatch callbacks,
which are running in concurrent threads.

accordingly, we need to protect these operations with a mutex, otherwise
they might return CS_OK without actually doing what they were supposed
to do (which in turn can lead to the dfsm taking a wrong turn and
getting stuck in a supposedly short-lived state, blocking access via
FUSE and getting whole clusters fenced).

huge thanks to Alexandre Derumier for providing the initial bug report
and quite a lot of test runs while debugging this issue.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
data/src/dfsm.c