diff --git a/SOURCES/lvm2-2_02_169-clvmd-add-mutex-protection-for-cpg_-call.patch b/SOURCES/lvm2-2_02_169-clvmd-add-mutex-protection-for-cpg_-call.patch new file mode 100644 index 0000000..c724772 --- /dev/null +++ b/SOURCES/lvm2-2_02_169-clvmd-add-mutex-protection-for-cpg_-call.patch @@ -0,0 +1,49 @@ +From dae4f53acb269219e876c229c8f034fcdaf3ff5a Mon Sep 17 00:00:00 2001 +From: Zdenek Kabelac +Date: Sat, 4 Feb 2017 14:47:27 +0100 +Subject: [PATCH] clvmd: add mutex protection for cpg_ call + +The library for corosync multicasting is not supporting multithread +usage - add local mutex to avoid parallel call of cpg_mcast_joined(). +--- + WHATS_NEW | 1 + + daemons/clvmd/clvmd-corosync.c | 4 ++++ + 2 files changed, 5 insertions(+) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 8ae2df8..0b571ae 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,5 +1,6 @@ + Version 2.02.169 - + ===================================== ++ Avoid parallel usage of cpg_mcast_joined() in clvmd with corosync. + Fix segfault in lvmetad from missing NULL in daemon_reply_simple. + + Version 2.02.167 - +diff --git a/daemons/clvmd/clvmd-corosync.c b/daemons/clvmd/clvmd-corosync.c +index 05c9882..2227cbf 100644 +--- a/daemons/clvmd/clvmd-corosync.c ++++ b/daemons/clvmd/clvmd-corosync.c +@@ -532,6 +532,7 @@ static int _cluster_fd_callback(struct local_client *fd, char *buf, int len, + static int _cluster_send_message(const void *buf, int msglen, const char *csid, + const char *errtext) + { ++ static pthread_mutex_t _mutex = PTHREAD_MUTEX_INITIALIZER; + struct iovec iov[2]; + cs_error_t err; + int target_node; +@@ -546,7 +547,10 @@ static int _cluster_send_message(const void *buf, int msglen, const char *csid, + iov[1].iov_base = (char *)buf; + iov[1].iov_len = msglen; + ++ pthread_mutex_lock(&_mutex); + err = cpg_mcast_joined(cpg_handle, CPG_TYPE_AGREED, iov, 2); ++ pthread_mutex_unlock(&_mutex); ++ + return cs_to_errno(err); + } + +-- +1.8.3.1 + diff --git a/SPECS/lvm2.spec b/SPECS/lvm2.spec index f3a216d..9c87b60 100644 --- a/SPECS/lvm2.spec +++ b/SPECS/lvm2.spec @@ -51,7 +51,7 @@ Summary: Userland logical volume management tools Name: lvm2 Epoch: 7 Version: 2.02.166 -Release: 1%{?dist}.3 +Release: 1%{?dist}.4 License: GPLv2 Group: System Environment/Base URL: http://sources.redhat.com/lvm2 @@ -67,6 +67,7 @@ Patch7: lvm2-2_02_167-fix-inability-of-lvconvert-repair-for-cache-raid-volumes.p Patch8: lvm2-2_02_167-fix-raid4-coversion-from-striped.patch Patch9: lvm2-2_02_167-prevent-raid4-creation-and-conversion-on-non-supporting-kernels.patch Patch10: lvm2-2_02_169-fix-segfault-in-lvmetad-from-missing-null-in-daemon_reply_simple.patch +Patch11: lvm2-2_02_169-clvmd-add-mutex-protection-for-cpg_-call.patch BuildRequires: libselinux-devel >= %{libselinux_version}, libsepol-devel BuildRequires: libblkid-devel >= %{util_linux_version} @@ -123,6 +124,7 @@ or more physical volumes and creating one or more logical volumes %patch8 -p1 -b .raid4_from_striped %patch9 -p1 -b .raid4_vs_kernel %patch10 -p1 -b .lvmetad_segfault +%patch11 -p1 -b .ipc_ring_corruption %build %global _default_pid_dir /run @@ -825,6 +827,10 @@ the device-mapper event library. %{_libdir}/pkgconfig/devmapper-event.pc %changelog +* Tue Apr 04 2017 Marian Csontos - 7:2.02.166-1.el7_3.4 +- Fix stuck corosync due to unsafe thread access to CPG causing IPC ringbuffer + corruption. + * Thu Feb 09 2017 Peter Rajnoha - 7:2.02.166-1.el7_3.3 - Fix segfault in lvmetad from missing NULL in daemon_reply_simple.