]> sourceware.org Git - lvm2.git/commit
clvmd: Fix client list corruption
authorAlasdair G Kergon <agk@redhat.com>
Sat, 1 Jul 2017 00:34:38 +0000 (01:34 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Sat, 1 Jul 2017 00:34:38 +0000 (01:34 +0100)
commitf2eda36cfa9baf3f7e132dbc3a3f34c908cb36d4
treeeda8b9317690cacfa8d21c6264dc34134a72113b
parentaf789fd6d0cba45cc4897772bae3ca73a3f15b38
clvmd: Fix client list corruption

Centralise editing of the client list into _add_client() and
_del_client().  Introduce _local_client_count to track the size of the
list for debugging purposes.  Simplify and standardise the various ways
the list gets walked.

While processing one element of the list in main_loop(),
cleanup_zombie() may be called and remove a different element, so make
sure main_loop() refreshes its list state on return.  Prior to this
patch, the list edits for clients disappearing could race against the
list edits for new clients connecting and corrupt the list and cause a
variety of segfaults.

An easy way to trigger such failures was by repeatedly running shell
commands such as:
  lvs &; lvs &; lvs &;...;killall -9 lvs; lvs &; lvs &;...

Situations that occasionally lead to the failures can be spotted by
looking for 'EOF' with 'inprogress=1' in the clvmd debug logs.
WHATS_NEW
daemons/clvmd/clvmd.c
This page took 0.038848 seconds and 5 git commands to generate.