Bug 1435779 - Inode ref leak on anonymous reads and writes
Summary: Inode ref leak on anonymous reads and writes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: libgfapi
Version: 3.10
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Niels de Vos
QA Contact: Sudhir D
URL:
Whiteboard:
Depends On: 1438738
Blocks: glusterfs-3.10.2
TreeView+ depends on / blocked
 
Reported: 2017-03-24 18:12 UTC by Simon Turcotte-Langevin
Modified: 2017-05-31 20:45 UTC (History)
5 users (show)

Fixed In Version: glusterfs-3.10.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1438738 (view as bug list)
Environment:
Last Closed: 2017-05-31 20:45:58 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)
Example program logging leaked inodes (2.12 KB, text/plain)
2017-03-26 00:07 UTC, Niels de Vos
no flags Details

Description Simon Turcotte-Langevin 2017-03-24 18:12:17 UTC
Description of problem:
When using the handles API of libgfapi, invoking glfs_h_anonymous_write() and 
or glfs_h_anonymous_read() on an opened object handle leaks inode references.

Version-Release number of selected component (if applicable):
GlusterFS 3.10.0

How reproducible:
glfs_new()
glfs_h_open()
glfs_h_anonymous_write()
glfs_h_close()
glfs_fini()

The following message will appear in the logs:

[2017-03-21 14:06:34.349446] W [inode.c:1845:inode_table_destroy] (-->/usr/lib64/libgfapi.so.0(glfs_fini+0x499) [0x7f97c4bf7679] -->/usr/lib64/libglusterfs.so.0(inode_table_destroy_all+0x51) [0x7f97c450e221] -->/usr/lib64/libglusterfs.so.0(inode_table_destroy+0xd5) [0x7f97c450e125] ) 0-gfapi: Active inode(0x7f9810552a80) with refcount(2) found during cleanup


Steps to Reproduce:
1. glfs_new()
2. glfs_h_open()
3. glfs_h_anonymous_write()
4. glfs_h_close()
5. glfs_fini()
6. Read the log

Actual results:
[2017-03-21 14:06:34.349446] W [inode.c:1845:inode_table_destroy] (-->/usr/lib64/libgfapi.so.0(glfs_fini+0x499) [0x7f97c4bf7679] -->/usr/lib64/libglusterfs.so.0(inode_table_destroy_all+0x51) [0x7f97c450e221] -->/usr/lib64/libglusterfs.so.0(inode_table_destroy+0xd5) [0x7f97c450e125] ) 0-gfapi: Active inode(0x7f9810552a80) with refcount(2) found during cleanup

Expected results:
No such message

Additional info:

Comment 2 Niels de Vos 2017-03-26 00:01:07 UTC
We do not support GlusterFS 3.10 in Red Hat Gluster Storage, so I assume this is a bug against the community version of Gluster and am relocating this bug.

I can reproduce the problem on one of my test systems with CentOS 7 and glusterfs-3.8.10.

Comment 3 Niels de Vos 2017-03-26 00:07:49 UTC
Created attachment 1266452 [details]
Example program logging leaked inodes

Compile this program with (assuming that the file is saved as bug-1435779.c):

    $ make CFLAGS="$(pkg-config --cflags --libs glusterfs-api)" bug-1435779

Run it with:

    $ ./bug-1435779 <hostname> <volname>
    # <hostname> is a gluster server
    # <volname> is a name of a volume

The bug-1435779.log file will contain the warning after running:

[2017-03-25 23:59:50.253520] W [inode.c:1809:inode_table_destroy] (-->/lib64/libgfapi.so.0(glfs_fini+0x40d) [0x7f958a1f794d] -->/lib64/libglusterfs.so.0(inode_table_destroy_all+0x51) [0x7f9589f37111] -->/lib64/libglusterfs.so.0(inode_table_destroy+0xd7) [0x7f9589f37017] ) 0-gfapi: Active inode(0x7f95693d1128) with refcount(1) found during cleanup

Comment 4 Worker Ant 2017-04-04 10:24:21 UTC
REVIEW: https://review.gluster.org/16989 (gfapi: Fix inode ref leak in anonymous fd I/O APIs) posted (#1) for review on master by soumya k (skoduri)

Comment 5 Worker Ant 2017-04-18 11:28:02 UTC
REVIEW: https://review.gluster.org/17074 (gfapi: Fix inode ref leak in anonymous fd I/O APIs) posted (#1) for review on release-3.10 by Niels de Vos (ndevos)

Comment 6 Worker Ant 2017-04-27 10:46:47 UTC
COMMIT: https://review.gluster.org/17074 committed in release-3.10 by Raghavendra Talur (rtalur) 
------
commit 12da472023f20ec0950d6a16125edd79e46812a0
Author: Soumya Koduri <skoduri>
Date:   Tue Apr 4 15:50:29 2017 +0530

    gfapi: Fix inode ref leak in anonymous fd I/O APIs
    
    In the APIs to do I/Os using anonymous fd, there
    is a ref taken for inode which hasn't been unreferenced
    post the operation. This shall result in the leak.
    
    Cherry picked from commit 761e2dc0432d3723e0f8cbb1cf192ad386addb08:
    > Change-Id: I75ea952a6b2df58c385f4f53398e5562f255248d
    > BUG: 1438738
    > Signed-off-by: Soumya Koduri <skoduri>
    > Reviewed-on: https://review.gluster.org/16989
    > Reviewed-by: Prashanth Pai <ppai>
    > Smoke: Gluster Build System <jenkins.org>
    > Reviewed-by: jiffin tony Thottan <jthottan>
    > Reviewed-by: Niels de Vos <ndevos>
    > NetBSD-regression: NetBSD Build System <jenkins.org>
    > CentOS-regression: Gluster Build System <jenkins.org>
    
    Change-Id: I75ea952a6b2df58c385f4f53398e5562f255248d
    BUG: 1435779
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: https://review.gluster.org/17074
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Prashanth Pai <ppai>
    Reviewed-by: jiffin tony Thottan <jthottan>
    Reviewed-by: soumya k <skoduri>
    CentOS-regression: Gluster Build System <jenkins.org>

Comment 7 Raghavendra Talur 2017-05-31 20:45:58 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.10.2, please open a new bug report.


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