Sorry I forget to attach the diff :)
Am 27.09.2013 21:32, schrieb Patrick Matthäi:
Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: pu
Hello,
glusterfs does not work with the current Wheezy Linux (>= 3.2.46-1+deb7u1)
anymore, if you use ext4 as storage backend. Salvatore backported the upstream
patch. I would be happy if I could upload this version to stable to make
glusterfs useable again. :)
Details and upstream ACK:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=722694
--
/*
Mit freundlichem Gruß / With kind regards,
Patrick Matthäi
GNU/Linux Debian Developer
E-Mail: pmatth...@debian.org
patr...@linux-dev.org
*/
diff -Naur '--exclude=.svn' tags/3.2.7-3/debian/changelog
branches/wheezy/debian/changelog
--- tags/3.2.7-3/debian/changelog 2012-11-12 20:37:46.218864002 +0100
+++ branches/wheezy/debian/changelog 2013-09-27 21:19:25.155488829 +0200
@@ -1,3 +1,11 @@
+glusterfs (3.2.7-3+deb7u1) stable; urgency=low
+
+ * Add patch 04-ext4-safe to fix broken glusterfs with Linux
+ >= 3.2.46-1+deb7u1 if you use ext4 as storage backend.
+ Closes: #722694
+
+ -- Patrick Matthäi <pmatth...@debian.org> Fri, 27 Sep 2013 21:13:42 +0200
+
glusterfs (3.2.7-3) unstable; urgency=low
* Remove duplicated and faulty call of the glusterd daemon from the init
diff -Naur '--exclude=.svn' tags/3.2.7-3/debian/patches/04-ext4-safe.diff
branches/wheezy/debian/patches/04-ext4-safe.diff
--- tags/3.2.7-3/debian/patches/04-ext4-safe.diff 1970-01-01
01:00:00.000000000 +0100
+++ branches/wheezy/debian/patches/04-ext4-safe.diff 2013-09-27
21:17:40.119491904 +0200
@@ -0,0 +1,137 @@
+# Upstream patch to fix broken glusterfs if you use ext4 as storage backend.
+# This was introduced with the Linux 3.2.46-1+deb7u1 version.
+# This patch has been backported by Salvatore Bonaccorso, thanks!
+# Closes: #722694
+
+diff -Naur glusterfs-3.2.7.orig/xlators/cluster/dht/src/dht-helper.c
glusterfs-3.2.7/xlators/cluster/dht/src/dht-helper.c
+--- glusterfs-3.2.7.orig/xlators/cluster/dht/src/dht-helper.c 2012-06-10
19:44:16.000000000 +0200
++++ glusterfs-3.2.7/xlators/cluster/dht/src/dht-helper.c 2013-09-27
21:05:25.895511703 +0200
+@@ -49,6 +49,43 @@
+ }
+
+
++static uint64_t
++dht_bits_for (uint64_t num)
++{
++ uint64_t bits = 0, ctrl = 1;
++
++ while (ctrl < num) {
++ ctrl *= 2;
++ bits ++;
++ }
++
++ return bits;
++}
++
++/*
++ * A slightly "updated" version of the algorithm described in the commit log
++ * is used here.
++ *
++ * The only enhancement is that:
++ *
++ * - The number of bits used by the backend filesystem for HUGE d_off which
++ * is described as 63, and
++ * - The number of bits used by the d_off presented by the transformation
++ * upwards which is described as 64, are both made "configurable."
++ */
++
++
++#define BACKEND_D_OFF_BITS 63
++#define PRESENT_D_OFF_BITS 63
++
++#define ONE 1ULL
++#define MASK (~0ULL)
++#define PRESENT_MASK (MASK >> (64 - PRESENT_D_OFF_BITS))
++#define BACKEND_MASK (MASK >> (64 - BACKEND_D_OFF_BITS))
++
++#define TOP_BIT (ONE << (PRESENT_D_OFF_BITS - 1))
++#define SHIFT_BITS (max (0, (BACKEND_D_OFF_BITS - PRESENT_D_OFF_BITS + 1)))
++
+ int
+ dht_itransform (xlator_t *this, xlator_t *subvol, uint64_t x, uint64_t *y_p)
+ {
+@@ -56,6 +93,9 @@
+ int cnt = 0;
+ int max = 0;
+ uint64_t y = 0;
++ uint64_t hi_mask = 0;
++ uint64_t off_mask = 0;
++ int max_bits = 0;
+
+ if (x == ((uint64_t) -1)) {
+ y = (uint64_t) -1;
+@@ -69,7 +109,23 @@
+ max = conf->subvolume_cnt;
+ cnt = dht_subvol_cnt (this, subvol);
+
+- y = ((x * max) + cnt);
++ if (max == 1) {
++ y = x;
++ goto out;
++ }
++
++ max_bits = dht_bits_for (max);
++
++ hi_mask = ~(PRESENT_MASK >> (max_bits + 1));
++
++ if (x & hi_mask) {
++ /* HUGE d_off */
++ off_mask = MASK << max_bits;
++ y = TOP_BIT | ((x >> SHIFT_BITS) & off_mask) | cnt;
++ } else {
++ /* small d_off */
++ y = ((x * max) + cnt);
++ }
+
+ out:
+ if (y_p)
+@@ -147,16 +203,38 @@
+ int max = 0;
+ uint64_t x = 0;
+ xlator_t *subvol = 0;
++ int max_bits = 0;
++ uint64_t off_mask = 0;
++ uint64_t host_mask = 0;
+
+ if (!this->private)
+- goto out;
++ return -1;
+
+ conf = this->private;
+ max = conf->subvolume_cnt;
+
+- cnt = y % max;
+- x = y / max;
++ if (max == 1) {
++ x = y;
++ cnt = 0;
++ goto out;
++ }
++
++ if (y & TOP_BIT) {
++ /* HUGE d_off */
++ max_bits = dht_bits_for (max);
++ off_mask = (MASK << max_bits);
++ host_mask = ~(off_mask);
++
++ x = ((y & ~TOP_BIT) & off_mask) << SHIFT_BITS;
++
++ cnt = y & host_mask;
++ } else {
++ /* small d_off */
++ cnt = y % max;
++ x = y / max;
++ }
+
++out:
+ subvol = conf->subvolumes[cnt];
+
+ if (subvol_p)
+@@ -165,7 +243,6 @@
+ if (x_p)
+ *x_p = x;
+
+-out:
+ return 0;
+ }
+
diff -Naur '--exclude=.svn' tags/3.2.7-3/debian/patches/series
branches/wheezy/debian/patches/series
--- tags/3.2.7-3/debian/patches/series 2012-11-12 20:37:46.218864002 +0100
+++ branches/wheezy/debian/patches/series 2013-09-27 21:14:21.015495625
+0200
@@ -1,3 +1,4 @@
01-manpage-errors.diff
02-spelling-error.diff
03-glusterd-crash-gcc-optimizations.diff
+04-ext4-safe.diff