From 7fac81aeab5805fb2bd719d7489636633bb5e32a Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 29 Oct 2018 14:16:20 +0530 Subject: 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 --- libglusterfs/src/statedump.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libglusterfs/src/statedump.c') diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c index be928a375d8..d0701e53a84 100644 --- a/libglusterfs/src/statedump.c +++ b/libglusterfs/src/statedump.c @@ -221,12 +221,13 @@ gf_proc_dump_xlator_mem_info(xlator_t *xl) gf_proc_dump_add_section("%s.%s - usage-type %s memusage", xl->type, xl->name, xl->mem_acct->rec[i].typestr); - gf_proc_dump_write("size", "%u", xl->mem_acct->rec[i].size); + gf_proc_dump_write("size", "%" PRIu64, xl->mem_acct->rec[i].size); gf_proc_dump_write("num_allocs", "%u", xl->mem_acct->rec[i].num_allocs); - gf_proc_dump_write("max_size", "%u", xl->mem_acct->rec[i].max_size); + gf_proc_dump_write("max_size", "%" PRIu64, + xl->mem_acct->rec[i].max_size); gf_proc_dump_write("max_num_allocs", "%u", xl->mem_acct->rec[i].max_num_allocs); - gf_proc_dump_write("total_allocs", "%u", + gf_proc_dump_write("total_allocs", "%" PRIu64, xl->mem_acct->rec[i].total_allocs); } -- cgit