Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1412174 - Memory leak on mount/fuse when setxattr fails
Summary: Memory leak on mount/fuse when setxattr fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: fuse
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Xavi Hernandez
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1412992 1412994 1412995
TreeView+ depends on / blocked
 
Reported: 2017-01-11 13:05 UTC by Xavi Hernandez
Modified: 2017-03-06 17:43 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.10.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1412992 1412994 1412995 (view as bug list)
Environment:
Last Closed: 2017-03-06 17:43:33 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Xavi Hernandez 2017-01-11 13:05:45 UTC
Description of problem:

When the setxattr fails for some extended attributes, fuse leaks memory.

This can happen if you try to set 'system.posix_acl_access' but gluster doesn't have acl's enabled.

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


How reproducible:

Always

Steps to Reproduce:
1. gluster volume create test server:/brick
2. mount -t glusterfs server:/test /test
3. touch /test/file
4. for i in {1..100000}; do setfattr -n system.posix_acl_access -v "1" /test/file; done

Actual results:

Doing a state dump, a leak of fuse_state_t structures is seen.

Expected results:

No leak should happen.

Additional info:

It seems that the state is not released after having been allocated if a pre-op check fails.

Comment 1 Worker Ant 2017-01-12 08:52:27 UTC
REVIEW: http://review.gluster.org/16380 (fuse: fix memory leak in setxattr) posted (#1) for review on master by Xavier Hernandez (xhernandez@datalab.es)

Comment 2 Worker Ant 2017-01-12 08:59:40 UTC
REVIEW: http://review.gluster.org/16380 (fuse: fix memory leak in setxattr) posted (#2) for review on master by Xavier Hernandez (xhernandez@datalab.es)

Comment 3 Worker Ant 2017-01-12 19:03:14 UTC
COMMIT: http://review.gluster.org/16380 committed in master by Jeff Darcy (jdarcy@redhat.com) 
------
commit 79b3fb6e8d3c9d681917be6e6c9f6ba04eb73f82
Author: Xavier Hernandez <xhernandez@datalab.es>
Date:   Thu Jan 12 08:38:50 2017 +0100

    fuse: fix memory leak in setxattr
    
    If there's some failed check in setxattr of mount/fuse before
    actually starting the operation, a fuse_state_t structure is
    leaked.
    
    This fix correctly releases allocated resources in case of
    error.
    
    Change-Id: I8b1cda67a613c13b6bc38947352e2ccfccf96a1d
    BUG: 1412174
    Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
    Reviewed-on: http://review.gluster.org/16380
    Smoke: Gluster Build System <jenkins@build.gluster.org>
    NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
    Reviewed-by: Niels de Vos <ndevos@redhat.com>
    CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
    Reviewed-by: Jeff Darcy <jdarcy@redhat.com>

Comment 4 Shyamsundar 2017-03-06 17:43:33 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.0, please open a new bug report.

glusterfs-3.10.0 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/2017-February/030119.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.