+++ This bug was initially created as a clone of Bug #1722801 +++
Description of problem:
The method used to calculate the power of two value for a type is off by 1 causing twice the required amount of memory to be allocated.
For example, cComparing the information for inode_t in statedumps from 3.4.4 and 3.5.0:
sizeof-type=255 <--- actual sizeof inode_t is 168
padded-sizeof=512 <--- padded size is twice the required amount
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create volume, fuse mount it and create some files and dirs on it
2. Take a statedump of the gluster mount process (kill -SIGUSR1 <pid>)
3. Compare the sizeof-type and padded-sizeof values in the state releases.
The padded-sizeof is twice the smallest power of two value for sizeof-type + sizeof(obj header)
The padded-sizeof should be the smallest power of two value for sizeof-type + sizeof(obj header)
--- Additional comment from RHEL Product and Program Management on 2019-06-21 11:10:14 UTC ---
This bug is automatically being proposed for the next minor release of Red Hat Gluster Storage by setting the release flag 'rhgs‑3.5.0' to '?'.
If this bug should be proposed for a different release, please manually change the proposed release flag.
REVIEW: https://review.gluster.org/22921 (core: fix memory allocation issues) posted (#4) for review on master by Xavi Hernandez
REVIEW: https://review.gluster.org/22921 (core: fix memory allocation issues) merged (#7) on master by Atin Mukherjee