Bug 1541267 - dht_layout_t leak in dht_populate_inode_for_dentry
Summary: dht_layout_t leak in dht_populate_inode_for_dentry
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: distribute
Version: 3.12
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On: 1541264 1541277
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-02 07:16 UTC by Nithya Balachandran
Modified: 2018-03-05 07:14 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.12.6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1541264
Environment:
Last Closed: 2018-03-05 07:14:08 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Nithya Balachandran 2018-02-02 07:16:00 UTC
+++ 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

Comment 1 Worker Ant 2018-02-02 12:43:05 UTC
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

Comment 2 Worker Ant 2018-02-08 04:05:18 UTC
COMMIT: https://review.gluster.org/19468 committed in release-3.12 by "N Balachandran" <nbalacha@redhat.com> 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@redhat.com>

Change-Id: I651bf539a0b82b4ddc4c355890c16a8e91f5f1fd
BUG: 1541267
Signed-off-by: N Balachandran <nbalacha@redhat.com>

Comment 3 Jiffin 2018-03-05 07:14:08 UTC
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/


Note You need to log in before you can comment on or make changes to this bug.