Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/bees/files/, sys-fs/bees/
Date: Sat, 30 Nov 2019 07:50:15
Message-Id: 1575100135.5edfb351c0192a34bbbbacd38a9c7fb7de1cf26d.juippis@gentoo
1 commit: 5edfb351c0192a34bbbbacd38a9c7fb7de1cf26d
2 Author: Kai Krakow <kai <AT> kaishome <DOT> de>
3 AuthorDate: Thu Nov 28 21:33:53 2019 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 30 07:48:55 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5edfb351
7
8 sys-fs/bees: Bump to v0.6.1-r2
9
10 Closes: https://bugs.gentoo.org/701422
11 Package-Manager: Portage-2.3.76, Repoman-2.3.16
12 Signed-off-by: Kai Krakow <kai <AT> kaishome.de>
13 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
14
15 sys-fs/bees/bees-0.6.1-r2.ebuild | 98 ++++++++++++++++++++++
16 ...cess-Fix-gettid-ambiguity-with-glibc-2.30.patch | 97 +++++++++++++++++++++
17 2 files changed, 195 insertions(+)
18
19 diff --git a/sys-fs/bees/bees-0.6.1-r2.ebuild b/sys-fs/bees/bees-0.6.1-r2.ebuild
20 new file mode 100644
21 index 00000000000..38c83939e49
22 --- /dev/null
23 +++ b/sys-fs/bees/bees-0.6.1-r2.ebuild
24 @@ -0,0 +1,98 @@
25 +# Copyright 1999-2019 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=7
29 +
30 +inherit linux-info systemd
31 +
32 +DESCRIPTION="Best-Effort Extent-Same, a btrfs dedup agent"
33 +HOMEPAGE="https://github.com/Zygo/bees"
34 +
35 +if [[ ${PV} == "9999" ]] ; then
36 + EGIT_REPO_URI="https://github.com/Zygo/bees.git"
37 + inherit git-r3
38 +else
39 + SRC_URI="https://github.com/Zygo/bees/archive/v${PV}.tar.gz -> ${P}.tar.gz"
40 + KEYWORDS="~amd64"
41 +fi
42 +
43 +LICENSE="GPL-3"
44 +SLOT="0"
45 +IUSE="tools"
46 +
47 +DEPEND="
48 + >=sys-apps/util-linux-2.30.2
49 + >=sys-fs/btrfs-progs-4.20.2
50 +"
51 +RDEPEND="${DEPEND}"
52 +
53 +CONFIG_CHECK="~BTRFS_FS"
54 +ERROR_BTRFS_FS="CONFIG_BTRFS_FS: bees does currently only work with btrfs"
55 +
56 +PATCHES=(
57 + "${FILESDIR}/6001-lib-fix-non-local-lambda-expression-cannot-have-a-ca.patch"
58 + "${FILESDIR}/6002-context-workaround-to-prevent-LOGICAL_INO-and-btrfs-.patch"
59 + "${FILESDIR}/6003-process-Fix-gettid-ambiguity-with-glibc-2.30.patch"
60 +)
61 +
62 +pkg_pretend() {
63 + if [[ ${MERGE_TYPE} != buildonly ]]; then
64 + if kernel_is -lt 4 4 3; then
65 + ewarn "Kernel versions below 4.4.3 lack critical features needed for bees to"
66 + ewarn "properly operate, so it won't work. It's recommended to run at least"
67 + ewarn "kernel version 4.11 for best performance and reliability."
68 + ewarn
69 + elif kernel_is -lt 4 11; then
70 + ewarn "With kernel versions below 4.11, bees may severely degrade system performance"
71 + ewarn "and responsiveness. Especially, the kernel may deadlock while bees is"
72 + ewarn "running, it's recommended to run at least kernel 4.11."
73 + ewarn
74 + elif kernel_is -lt 4 14 29; then
75 + ewarn "With kernel versions below 4.14.29, bees may generate a lot of bogus WARN_ON()"
76 + ewarn "messages in the kernel log. These messages can be ignored and this is fixed"
77 + ewarn "with more recent kernels:"
78 + ewarn "# WARNING: CPU: 3 PID: 18172 at fs/btrfs/backref.c:1391 find_parent_nodes+0xc41/0x14e0"
79 + ewarn
80 + fi
81 +
82 + if kernel_is -lt 5 3 4; then
83 + ewarn "With kernel versions below 5.3.4, bees may trigger a btrfs bug when running"
84 + ewarn "btrfs-balance in parallel. This may lead to meta-data corruption in the worst"
85 + ewarn "case. Especially, kernels 5.1.21 and 5.2.21 should be avoided. Kernels 5.0.x"
86 + ewarn "after 5.0.21 should be safe. In the best case, affected kernels may force"
87 + ewarn "the device RO without writing corrupted meta-data. More details:"
88 + ewarn "https://github.com/Zygo/bees/blob/master/docs/btrfs-kernel.md"
89 + ewarn
90 + fi
91 +
92 + if kernel_is -lt 5 0 4; then
93 + ewarn "IMPORTANT: With kernel versions below 5.0.4, you may experience data corruption"
94 + ewarn "due to bees using compression in btrfs. You are adviced to use a chronologically"
95 + ewarn "later kernel, that includes older LTS versions released after 5.0.4:"
96 + ewarn "Fixed in: 5.1+, 5.0.4+, 4.19.31+, 4.14.108+, 4.9.165+, 4.4.177+, 3.18.137+"
97 + ewarn "# commit 8e92821 btrfs: fix corruption reading shared and compressed extents after hole punching"
98 + ewarn
99 + fi
100 +
101 + elog "Bees recommends running the latest current kernel for performance and"
102 + elog "reliability reasons, see README.md."
103 + fi
104 +}
105 +
106 +src_configure() {
107 + cat >localconf <<-EOF || die
108 + LIBEXEC_PREFIX=/usr/libexec
109 + PREFIX=/usr
110 + LIBDIR="$(get_libdir)"
111 + SYSTEMD_SYSTEM_UNIT_DIR="$(systemd_get_systemunitdir)"
112 + DEFAULT_MAKE_TARGET=all
113 + EOF
114 + if [[ ${PV} != "9999" ]] ; then
115 + cat >>localconf <<-EOF || die
116 + BEES_VERSION=v${PV}
117 + EOF
118 + fi
119 + if use tools; then
120 + echo OPTIONAL_INSTALL_TARGETS=install_tools >>localconf || die
121 + fi
122 +}
123
124 diff --git a/sys-fs/bees/files/6003-process-Fix-gettid-ambiguity-with-glibc-2.30.patch b/sys-fs/bees/files/6003-process-Fix-gettid-ambiguity-with-glibc-2.30.patch
125 new file mode 100644
126 index 00000000000..9f53e5b37da
127 --- /dev/null
128 +++ b/sys-fs/bees/files/6003-process-Fix-gettid-ambiguity-with-glibc-2.30.patch
129 @@ -0,0 +1,97 @@
130 +From 0b7cf9c0f11722c7cb8a816e9118602b43d9a3f5 Mon Sep 17 00:00:00 2001
131 +From: Zygo Blaxell <bees@×××××××××××.org>
132 +Date: Tue, 29 Oct 2019 23:34:36 -0400
133 +Subject: [PATCH 3/3] process: Fix gettid() ambiguity with glibc >= 2.30
134 +MIME-Version: 1.0
135 +Content-Type: text/plain; charset=UTF-8
136 +Content-Transfer-Encoding: 8bit
137 +
138 +In version 2.30 glibc added it's own gettid() function. This resulted in
139 +"error: call of overloaded ‘gettid()’ is ambiguous" because gettid()
140 +now exists in both namespace crucible and std.
141 +
142 +For now, use explicit references to namespace crucible. This continues
143 +to work with new and old libc without having to test specific library
144 +versions.
145 +
146 +At some point, glibc gettid() will be deployed widely enough that we can
147 +remove the crucible version entirely.
148 +
149 +Signed-off-by: Zygo Blaxell <bees@×××××××××××.org>
150 +---
151 + include/crucible/lockset.h | 4 ++--
152 + lib/chatter.cc | 4 ++--
153 + src/bees.cc | 6 +++---
154 + 3 files changed, 7 insertions(+), 7 deletions(-)
155 +
156 +diff --git a/include/crucible/lockset.h b/include/crucible/lockset.h
157 +index 856c55e..99500b7 100644
158 +--- a/include/crucible/lockset.h
159 ++++ b/include/crucible/lockset.h
160 +@@ -117,7 +117,7 @@ namespace crucible {
161 + while (full() || locked(name)) {
162 + m_condvar.wait(lock);
163 + }
164 +- auto rv = m_set.insert(make_pair(name, gettid()));
165 ++ auto rv = m_set.insert(make_pair(name, crucible::gettid()));
166 + THROW_CHECK0(runtime_error, rv.second);
167 + }
168 +
169 +@@ -129,7 +129,7 @@ namespace crucible {
170 + if (full() || locked(name)) {
171 + return false;
172 + }
173 +- auto rv = m_set.insert(make_pair(name, gettid()));
174 ++ auto rv = m_set.insert(make_pair(name, crucible::gettid()));
175 + THROW_CHECK1(runtime_error, name, rv.second);
176 + return true;
177 + }
178 +diff --git a/lib/chatter.cc b/lib/chatter.cc
179 +index cbd5adb..e5a24f9 100644
180 +--- a/lib/chatter.cc
181 ++++ b/lib/chatter.cc
182 +@@ -69,14 +69,14 @@ namespace crucible {
183 + DIE_IF_ZERO(strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &ltm));
184 +
185 + header_stream << buf;
186 +- header_stream << " " << getpid() << "." << gettid() << "<" << m_loglevel << ">";
187 ++ header_stream << " " << getpid() << "." << crucible::gettid() << "<" << m_loglevel << ">";
188 + if (!m_name.empty()) {
189 + header_stream << " " << m_name;
190 + }
191 + } else {
192 + header_stream << "<" << m_loglevel << ">";
193 + header_stream << (m_name.empty() ? "thread" : m_name);
194 +- header_stream << "[" << gettid() << "]";
195 ++ header_stream << "[" << crucible::gettid() << "]";
196 + }
197 +
198 + header_stream << ": ";
199 +diff --git a/src/bees.cc b/src/bees.cc
200 +index 08c3fd7..aa55af0 100644
201 +--- a/src/bees.cc
202 ++++ b/src/bees.cc
203 +@@ -115,9 +115,9 @@ BeesNote::~BeesNote()
204 + tl_next = m_prev;
205 + unique_lock<mutex> lock(s_mutex);
206 + if (tl_next) {
207 +- s_status[gettid()] = tl_next;
208 ++ s_status[crucible::gettid()] = tl_next;
209 + } else {
210 +- s_status.erase(gettid());
211 ++ s_status.erase(crucible::gettid());
212 + }
213 + }
214 +
215 +@@ -128,7 +128,7 @@ BeesNote::BeesNote(function<void(ostream &os)> f) :
216 + m_prev = tl_next;
217 + tl_next = this;
218 + unique_lock<mutex> lock(s_mutex);
219 +- s_status[gettid()] = tl_next;
220 ++ s_status[crucible::gettid()] = tl_next;
221 + }
222 +
223 + void
224 +--
225 +2.23.0
226 +