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-data.h | |
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-data.h')
-rw-r--r-- | xlators/cluster/ec/src/ec-data.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/xlators/cluster/ec/src/ec-data.h b/xlators/cluster/ec/src/ec-data.h index cf9ce241adb..71f047a9aba 100644 --- a/xlators/cluster/ec/src/ec-data.h +++ b/xlators/cluster/ec/src/ec-data.h @@ -181,8 +181,8 @@ struct _ec_fop_data int32_t locked; ec_lock_link_t locks[2]; int32_t have_size; - size_t pre_size; - size_t post_size; + uint64_t pre_size; + uint64_t post_size; gf_lock_t lock; uint32_t flags; @@ -198,14 +198,14 @@ struct _ec_fop_data ec_cbk_t cbks; void * data; - size_t user_size; - size_t head; + uint64_t user_size; + uint32_t head; dict_t * xdata; dict_t * dict; int32_t int32; uint32_t uint32; - size_t size; + uint64_t size; off_t offset; mode_t mode[2]; entrylk_cmd entrylk_cmd; @@ -238,7 +238,7 @@ struct _ec_cbk_data dict_t * dict; int32_t int32; uintptr_t uintptr[3]; - size_t size; + uint64_t size; uint64_t version; inode_t * inode; fd_t * fd; @@ -264,10 +264,10 @@ struct _ec_heal uintptr_t good; uintptr_t bad; uintptr_t open; - off_t offset; - size_t size; + uint64_t offset; + uint64_t size; uint64_t version; - size_t raw_size; + uint64_t raw_size; }; ec_cbk_data_t * ec_cbk_data_allocate(call_frame_t * frame, xlator_t * this, |