+++ This bug was initially created as a clone of Bug #1541264 +++ Description of problem: dht_populate_inode_for_dentry does not check if the inode already has a layout set and overwrites the value each time without freeing the already existing layout. This happens only in non-distributed volumes (where dht has a single child subvol). Version-Release number of selected component (if applicable): How reproducible: Consistently Steps to Reproduce: 1.Create a 1x2 volume 2.Fuse mount the volume and create 5 directories in the root of the volume. mkdir dir-{1..5} 3. Take a statedump of the mount process. 4. Run ls -lR in a loop. for i in {1..10000}; do ls -lR; done 5. After the loop completes, take another statedump of the mount process and compare the values for usage-type gf_dht_mt_dht_layout_t memusage Actual results: With the latest upstream master: Before: ====== [cluster/distribute.leak-dht - usage-type gf_dht_mt_dht_layout_t memusage] size=456 num_allocs=8 max_size=584 max_num_allocs=10 total_allocs=21 After: ===== [cluster/distribute.leak-dht - usage-type gf_dht_mt_dht_layout_t memusage] size=10240520 num_allocs=160009 max_size=10240520 max_num_allocs=160009 total_allocs=160027 Expected results: No leak Additional info: ---------------------------------------------------------------------- Results after commenting out the call to dht_populate_inode_for_dentry ---------------------------------------------------------------------- Before: ======= [cluster/distribute.leak-dht - usage-type gf_dht_mt_dht_layout_t memusage] size=456 num_allocs=8 max_size=456 max_num_allocs=8 total_allocs=8 After: ====== [cluster/distribute.leak-dht - usage-type gf_dht_mt_dht_layout_t memusage] size=456 num_allocs=8 max_size=456 max_num_allocs=8 total_allocs=8 -------------------------------------------------------------- --- Additional comment from Worker Ant on 2018-02-02 02:10:49 EST --- REVIEW: https://review.gluster.org/19458 (cluster/dht: Fixed leak in dht_populate_inode_for_dentry) posted (#1) for review on master by N Balachandran
REVIEW: https://review.gluster.org/19468 (cluster/dht: Fixed leak in dht_populate_inode_for_dentry) posted (#1) for review on release-3.12 by N Balachandran
COMMIT: https://review.gluster.org/19468 committed in release-3.12 by "N Balachandran" <nbalacha> with a commit message- cluster/dht: Fixed leak in dht_populate_inode_for_dentry Fixed an issue in dht_populate_inode_for_dentry where a layout is set in the inode without checking if it is already set. This overwrites the value each time without freeing the already existing layout. Also includes the changes in https://review.gluster.org/19471 > Change-Id: I651bf539a0b82b4ddc4c355890c16a8e91f5f1fd > BUG: 1541264 > Signed-off-by: N Balachandran <nbalacha> Change-Id: I651bf539a0b82b4ddc4c355890c16a8e91f5f1fd BUG: 1541267 Signed-off-by: N Balachandran <nbalacha>
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.12.6, please open a new bug report. glusterfs-3.12.6 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution. [1] http://lists.gluster.org/pipermail/gluster-users/2018-February/033552.html [2] https://www.gluster.org/pipermail/gluster-users/