summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2014-11-25 09:54:29 +0100
committerVijay Bellur <vbellur@redhat.com>2014-12-04 11:35:19 -0800
commitca2a3949715fb25862d1e34f9e65283287faa842 (patch)
tree9e54be49bc0c6a363aaf475b3b14b34966407715 /xlators/cluster/ec
parentbc91dd4de39ffd481a52b837f322f6782c14e9f1 (diff)
ec: Fix incorrect value of EC_MAX_NODES
EC_MAX_NODES was incorrectly calculated. Now the value if computed as the minimum between the theoretical maximum and the limit imposed by the Galois Field. Change-Id: I75a8345147f344f051923d66be2c10d405370c7b BUG: 1167419 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9193 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/cluster/ec')
-rw-r--r--xlators/cluster/ec/src/ec-method.h3
-rw-r--r--xlators/cluster/ec/src/ec.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/xlators/cluster/ec/src/ec-method.h b/xlators/cluster/ec/src/ec-method.h
index 085de8f4b17..29b46e10443 100644
--- a/xlators/cluster/ec/src/ec-method.h
+++ b/xlators/cluster/ec/src/ec-method.h
@@ -13,7 +13,10 @@
#include "ec-gf.h"
+/* Determines the maximum size of the matrix used to encode/decode data */
#define EC_METHOD_MAX_FRAGMENTS 16
+/* Determines the maximum number of usable elements in the Galois Field */
+#define EC_METHOD_MAX_NODES (EC_GF_SIZE - 1)
#define EC_METHOD_WORD_SIZE 64
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
index c702ce3f0fd..c6d3b9fe718 100644
--- a/xlators/cluster/ec/src/ec.c
+++ b/xlators/cluster/ec/src/ec.c
@@ -23,7 +23,7 @@
* using the rule that redundancy cannot be equal or greater than the number
* of fragments.
*/
-#define EC_MAX_NODES (EC_MAX_FRAGMENTS + ((EC_MAX_FRAGMENTS - 1) / 2))
+#define EC_MAX_NODES min(EC_MAX_FRAGMENTS * 2 - 1, EC_METHOD_MAX_NODES)
int32_t ec_parse_options(xlator_t * this)
{