diff options
| -rw-r--r-- | libglusterfs/src/mem-pool.c | 4 | ||||
| -rw-r--r-- | libglusterfs/src/statedump.c | 4 | ||||
| -rwxr-xr-x | tests/bugs/core/bug-834465.t | 8 | 
3 files changed, 3 insertions, 13 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index 9a1320993d3..9533a733959 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -318,10 +318,6 @@ __gf_free (void *free_ptr)          {                  mem_acct->rec[header->type].size -= header->size;                  mem_acct->rec[header->type].num_allocs--; -                /* If all the instaces are freed up then ensure typestr is -                 * set to NULL */ -                if (!mem_acct->rec[header->type].num_allocs) -                        mem_acct->rec[header->type].typestr = NULL;          }          UNLOCK (&mem_acct->rec[header->type].lock); diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c index caf228a8b01..d4e7dbb3836 100644 --- a/libglusterfs/src/statedump.c +++ b/libglusterfs/src/statedump.c @@ -223,7 +223,6 @@ static void  gf_proc_dump_xlator_mem_info (xlator_t *xl)  {          int     i = 0; -        struct mem_acct rec = {0,};          if (!xl)                  return; @@ -235,8 +234,7 @@ gf_proc_dump_xlator_mem_info (xlator_t *xl)          gf_proc_dump_write ("num_types", "%d", xl->mem_acct->num_types);          for (i = 0; i < xl->mem_acct->num_types; i++) { -                if (!(memcmp (&xl->mem_acct->rec[i], &rec, -                              sizeof (struct mem_acct)))) +                if (xl->mem_acct->rec[i].total_allocs == 0)                          continue;                  gf_proc_dump_add_section ("%s.%s - usage-type %s memusage", diff --git a/tests/bugs/core/bug-834465.t b/tests/bugs/core/bug-834465.t index 4bdee83ed2d..e21e95393a6 100755 --- a/tests/bugs/core/bug-834465.t +++ b/tests/bugs/core/bug-834465.t @@ -25,7 +25,7 @@ nalloc1=0  grep -A3 "fuse - usage-type gf_common_mt_fd_lk_ctx_node_t" $sdump1  if [ $? -eq '0' ]  then -        nalloc1=`grep -A3 "fuse - usage-type gf_common_mt_fd_lk_ctx_node_t" $sdump1 | grep num_allocs | cut -d '=' -f2` +        nalloc1=`grep -A3 "fuse - usage-type gf_common_mt_fd_lk_ctx_node_t" $sdump1 | grep -E "^num_allocs" | cut -d '=' -f2`  fi  build_tester $(dirname $0)/bug-834465.c @@ -34,11 +34,7 @@ TEST $(dirname $0)/bug-834465 $M0/testfile  sdump2=$(generate_mount_statedump $V0); -# With _gf_free now setting typestr to NULL when num_allocs become 0, it is -# expected that there wouldn't be any entry for gf_common_mt_fd_lk_ctx_node_t -# in the statedump file now - -nalloc2=`grep -A3 "fuse - usage-type gf_common_mt_fd_lk_ctx_node_t" $sdump2 | wc -l` +nalloc2=`grep -A3 "fuse - usage-type gf_common_mt_fd_lk_ctx_node_t" $sdump2 | grep -E "^num_allocs" | cut -d '=' -f2`  TEST [ $nalloc1 -eq $nalloc2 ];  TEST rm -rf $MOUNTDIR/*  | 
