summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-cluster/ceph/ChangeLog6
-rw-r--r--sys-cluster/ceph/ceph-0.87.1.ebuild3
-rw-r--r--sys-cluster/ceph/files/ceph-0.87.1-glibc-2.20.patch59
3 files changed, 66 insertions, 2 deletions
diff --git a/sys-cluster/ceph/ChangeLog b/sys-cluster/ceph/ChangeLog
index 79678c34611e..2a5848fc6d2f 100644
--- a/sys-cluster/ceph/ChangeLog
+++ b/sys-cluster/ceph/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-cluster/ceph
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/ceph/ChangeLog,v 1.66 2015/03/03 09:10:33 dlan Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/ceph/ChangeLog,v 1.67 2015/03/05 21:24:30 dlan Exp $
+
+ 05 Mar 2015; Yixun Lan <dlan@gentoo.org> ceph-0.87.1.ebuild,
+ +files/ceph-0.87.1-glibc-2.20.patch:
+ fix segfault if using =glibc-2.20, bug 529076
*ceph-0.93 (03 Mar 2015)
*ceph-0.87.1 (03 Mar 2015)
diff --git a/sys-cluster/ceph/ceph-0.87.1.ebuild b/sys-cluster/ceph/ceph-0.87.1.ebuild
index 679748965b36..d496d0e2ff4a 100644
--- a/sys-cluster/ceph/ceph-0.87.1.ebuild
+++ b/sys-cluster/ceph/ceph-0.87.1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/ceph/ceph-0.87.1.ebuild,v 1.1 2015/03/03 09:10:33 dlan Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/ceph/ceph-0.87.1.ebuild,v 1.2 2015/03/05 21:24:30 dlan Exp $
EAPI=5
PYTHON_COMPAT=( python{2_6,2_7} )
@@ -74,6 +74,7 @@ REQUIRED_USE="
STRIP_MASK="/usr/lib*/rados-classes/*"
PATCHES=(
+ "${FILESDIR}"/${PN}-0.87.1-glibc-2.20.patch
"${FILESDIR}"/${PN}-0.79-libzfs.patch
)
diff --git a/sys-cluster/ceph/files/ceph-0.87.1-glibc-2.20.patch b/sys-cluster/ceph/files/ceph-0.87.1-glibc-2.20.patch
new file mode 100644
index 000000000000..55a49d72f687
--- /dev/null
+++ b/sys-cluster/ceph/files/ceph-0.87.1-glibc-2.20.patch
@@ -0,0 +1,59 @@
+From cf2104d4d991361c53f6e2fea93b69de10cd654b Mon Sep 17 00:00:00 2001
+From: Federico Simoncelli <fsimonce@redhat.com>
+Date: Sat, 15 Nov 2014 14:14:04 +0000
+Subject: [PATCH] common: do not unlock rwlock on destruction
+
+According to pthread_rwlock_unlock(3p):
+
+ Results are undefined if the read-write lock rwlock is not held
+ by the calling thread.
+
+and:
+
+ https://sourceware.org/bugzilla/show_bug.cgi?id=17561
+
+ Calling pthread_rwlock_unlock on an rwlock which is not locked
+ is undefined.
+
+calling pthread_rwlock_unlock on RWLock destruction could cause
+an unknown behavior for two reasons:
+
+- the lock is acquired by another thread (undefined)
+- the lock is not acquired (undefined)
+
+Moreover since glibc-2.20 calling pthread_rwlock_unlock on a
+rwlock that is not locked results in a SIGILL that kills the
+application.
+
+This patch removes the pthread_rwlock_unlock call on destruction
+and replaces it with an assertion to check that the RWLock is
+not in use.
+
+Any code that relied on the implicit release is now going to
+break the assertion, e.g.:
+
+ {
+ RWLock l;
+ l.get(for_write);
+ } // implicit release, wrong.
+
+Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
+---
+ src/common/RWLock.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/common/RWLock.h b/src/common/RWLock.h
+index e647e17..6f0ab8e 100644
+--- a/src/common/RWLock.h
++++ b/src/common/RWLock.h
+@@ -46,7 +46,9 @@ class RWLock
+ return (nwlock.read() > 0);
+ }
+ virtual ~RWLock() {
+- pthread_rwlock_unlock(&L);
++ // The following check is racy but we are about to destroy
++ // the object and we assume that there are no other users.
++ assert(!is_locked());
+ pthread_rwlock_destroy(&L);
+ }
+