summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/mem-pool.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2018-10-29 14:16:20 +0530
committerAmar Tumballi <amarts@redhat.com>2018-11-01 02:38:39 +0000
commit7fac81aeab5805fb2bd719d7489636633bb5e32a (patch)
tree793a81e96849918fec893a5c78ba83ff8e703d79 /libglusterfs/src/mem-pool.c
parent7150c51ad75ccba22045a35fc31e5037612d1ad4 (diff)
mem-pool: change the values to 64bits
total_allocs of certain type of variables can be 4billion in a single day depending on load. So, 32 bits for that is not enough. Also, size_t is good variable size for one allocation, but the sum of allocations, should be 64bits to make sure we don't overflow the variable. Updates: bz#1639599 Change-Id: If3b19687f94425e913a0201ae5d73661eda51f06 Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'libglusterfs/src/mem-pool.c')
-rw-r--r--libglusterfs/src/mem-pool.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c
index ad433d4af2d..caf8bf2fa0c 100644
--- a/libglusterfs/src/mem-pool.c
+++ b/libglusterfs/src/mem-pool.c
@@ -342,6 +342,7 @@ __gf_free(void *free_ptr)
LOCK(&mem_acct->rec[header->type].lock);
{
+ GF_ASSERT(mem_acct->rec[header->type].size >= header->size);
mem_acct->rec[header->type].size -= header->size;
mem_acct->rec[header->type].num_allocs--;
/* If all the instances are freed up then ensure typestr is set