diff options
author | Xavier Hernandez <xhernandez@datalab.es> | 2014-09-15 11:57:43 +0200 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-19 03:02:47 -0700 |
commit | f32378b660dab5f3f311da8252969a7da16898f4 (patch) | |
tree | 5314df4ba69ac7e0e600f867e9e95dbae0759e1a /xlators/cluster/ec/src/ec-combine.c | |
parent | c788a7784d8526b72714d60bac6e1e09ae985a84 (diff) |
ec: Fix some size_t vars to 64 bits even on 32 bits machines
The 64 bits 'trusted.ec.size' extended attribute was incorrectly
computed on 32 bits machines due to an overflow on negative
numbers.
Also changed some potentially dangerous uses of size_t in other
places.
Change-Id: Id76cfe49a2f350e564b5c71d8c8644fb9ce86662
BUG: 1125312
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/8738
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-combine.c')
-rw-r--r-- | xlators/cluster/ec/src/ec-combine.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xlators/cluster/ec/src/ec-combine.c b/xlators/cluster/ec/src/ec-combine.c index 02b7e6024fd..0fa5ac068de 100644 --- a/xlators/cluster/ec/src/ec-combine.c +++ b/xlators/cluster/ec/src/ec-combine.c @@ -108,7 +108,7 @@ int32_t ec_iatt_combine(struct iatt * dst, struct iatt * src, int32_t count) void ec_iatt_rebuild(ec_t * ec, struct iatt * iatt, int32_t count, int32_t answers) { - size_t blocks; + uint64_t blocks; while (count-- > 0) { @@ -285,11 +285,10 @@ int32_t ec_dict_data_concat(const char * fmt, ec_cbk_data_t * cbk, int32_t which, char * key, ...) { data_t * data[cbk->count]; - size_t len, tmp; char * str = NULL, * pre = NULL, * sep, * post; dict_t * dict; va_list args; - int32_t i, num, prelen, postlen, seplen; + int32_t i, num, len, prelen, postlen, seplen, tmp; int32_t ret = -1; num = cbk->count; @@ -589,7 +588,7 @@ int32_t ec_dict_combine(ec_cbk_data_t * cbk, int32_t which) int32_t ec_vector_compare(struct iovec * dst_vector, int32_t dst_count, struct iovec * src_vector, int32_t src_count) { - size_t dst_size = 0, src_size = 0; + int32_t dst_size = 0, src_size = 0; if (dst_count > 0) { |