Bug 1344714 - removal of file from nfs mount crashs ganesha server
Summary: removal of file from nfs mount crashs ganesha server
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: upcall
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Niels de Vos
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1347715 1347717 1370931 1375554 1378948 1378949 1379982 1391851
TreeView+ depends on / blocked
 
Reported: 2016-06-10 13:15 UTC by Jiffin
Modified: 2017-03-06 17:20 UTC (History)
3 users (show)

Fixed In Version: glusterfs-3.10.0
Clone Of:
: 1347715 1378948 1378949 (view as bug list)
Environment:
Last Closed: 2017-03-06 17:20:39 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Jiffin 2016-06-10 13:15:53 UTC
Description of problem:

The struct callback_inode_arg is a variable used by upcall infra for populating upcall entries. This variable is allocated using GF_CALLOC in glfs_h_poll_cache_invalidation(), but it also freedin FSAL_GLUSTER using free.
This will result in a crash when we try to remove a file from mount

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

How reproducible:


Steps to Reproduce:
1. enable nfs-ganesha and export a volume 
2. mount the volume
3. create a file and delete it from the mount

Actual results:
ganesha server crashes

Expected results:
should not crash

Additional info:

Comment 1 Vijay Bellur 2016-06-10 13:17:53 UTC
REVIEW: http://review.gluster.org/14701 (libgfapi : Introducing glfs_free() api) posted (#1) for review on master by jiffin tony Thottan (jthottan)

Comment 2 Vijay Bellur 2016-06-10 13:17:56 UTC
REVIEW: http://review.gluster.org/14702 (libgfapi/upcall : appending glfs to callback_arg, callback_inode_arg) posted (#1) for review on master by jiffin tony Thottan (jthottan)

Comment 3 Vijay Bellur 2016-06-10 20:57:16 UTC
REVIEW: http://review.gluster.org/14702 (libgfapi/upcall : prepend "glfs_" to callback_arg, callback_inode_arg) posted (#2) for review on master by Jeff Darcy (jdarcy)

Comment 4 Vijay Bellur 2016-06-10 21:09:37 UTC
COMMIT: http://review.gluster.org/14702 committed in master by Jeff Darcy (jdarcy) 
------
commit 2775dc64101ed37c8d9809bf9852dbf0746ee2b6
Author: Jiffin Tony Thottan <jthottan>
Date:   Fri Jun 10 18:23:43 2016 +0530

    libgfapi/upcall : prepend "glfs_" to callback_arg, callback_inode_arg
    
    Change-Id: I371525775db4f6a4d69beb94baaa53d17b16fb41
    BUG: 1344714
    Signed-off-by: Jiffin Tony Thottan <jthottan>
    Reviewed-on: http://review.gluster.org/14702
    CentOS-regression: Gluster Build System <jenkins.com>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Jeff Darcy <jdarcy>
    Tested-by: Jeff Darcy <jdarcy>
    Smoke: Gluster Build System <jenkins.com>

Comment 5 Vijay Bellur 2016-06-14 08:58:05 UTC
REVIEW: http://review.gluster.org/14701 (libgfapi : Introducing glfs_free_callback_inode_arg() api) posted (#2) for review on master by jiffin tony Thottan (jthottan)

Comment 6 Vijay Bellur 2016-06-14 10:14:16 UTC
REVIEW: http://review.gluster.org/14701 (libgfapi : Introducing glfs_free_callback_inode_arg() api) posted (#3) for review on master by jiffin tony Thottan (jthottan)

Comment 7 Vijay Bellur 2016-06-16 13:28:10 UTC
REVIEW: http://review.gluster.org/14701 (libgfapi : Introducing glfs_free_callback_inode_arg() api) posted (#4) for review on master by jiffin tony Thottan (jthottan)

Comment 8 Vijay Bellur 2016-06-16 13:30:18 UTC
REVIEW: http://review.gluster.org/14701 (libgfapi : Introducing glfs_free_callback_inode_arg() api) posted (#5) for review on master by jiffin tony Thottan (jthottan)

Comment 9 Vijay Bellur 2016-06-16 13:41:28 UTC
REVIEW: http://review.gluster.org/14701 (libgfapi : free glfs_callback_inode_arg from application layer) posted (#6) for review on master by jiffin tony Thottan (jthottan)

Comment 10 Vijay Bellur 2016-06-17 12:46:07 UTC
REVIEW: http://review.gluster.org/14759 (libgfapi/upcall : use calloc and free for callback_inode_arg) posted (#1) for review on master by jiffin tony Thottan (jthottan)

Comment 11 Vijay Bellur 2016-08-08 09:05:35 UTC
REVIEW: http://review.gluster.org/14701 (gfapi: redesign the public interface for upcall consumers) posted (#7) for review on master by Niels de Vos (ndevos)

Comment 12 Vijay Bellur 2016-08-08 09:05:39 UTC
REVIEW: http://review.gluster.org/15108 (libglusterfs: add gf_get_mem_type()) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 13 Vijay Bellur 2016-08-08 10:22:24 UTC
REVIEW: http://review.gluster.org/14701 (gfapi: redesign the public interface for upcall consumers) posted (#8) for review on master by Niels de Vos (ndevos)

Comment 14 Vijay Bellur 2016-08-15 07:56:58 UTC
COMMIT: http://review.gluster.org/15108 committed in master by Niels de Vos (ndevos) 
------
commit db4e26ed71a01e5f760fbc3c7051962426f102c9
Author: Niels de Vos <ndevos>
Date:   Sat Aug 6 16:04:29 2016 +0200

    libglusterfs: add gf_get_mem_type()
    
    gfapi needs to provide a function towards applications to free memory
    that it allocated. Depending on how the application is compiled/linked,
    it could use a different memory allocator than Gluster itself. Therefore
    it is not safe for gfapi to request applications to free memory with
    'standard' free().
    
    Examples for this are Gluster allocated structures with GF_CALLOC() when
    memory accounting is enabled (the default). Some gfapi functions use
    malloc() to allocate memory as a workaround, but the free() from the
    jemalloc implementation should not be combined with the malloc() from
    glibc.
    
    Change-Id: I626cd1a60abf8965f9263290f4045d1f69fc2093
    BUG: 1344714
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/15108
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: soumya k <skoduri>
    Reviewed-by: jiffin tony Thottan <jthottan>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Shyamsundar Ranganathan <srangana>

Comment 15 Worker Ant 2016-08-28 14:36:30 UTC
REVIEW: http://review.gluster.org/14701 (gfapi: redesign the public interface for upcall consumers) posted (#9) for review on master by Niels de Vos (ndevos)

Comment 16 Worker Ant 2016-08-29 11:52:12 UTC
REVIEW: http://review.gluster.org/14701 (gfapi: redesign the public interface for upcall consumers) posted (#10) for review on master by Niels de Vos (ndevos)

Comment 17 Worker Ant 2016-08-29 20:05:09 UTC
REVIEW: http://review.gluster.org/14701 (gfapi: redesign the public interface for upcall consumers) posted (#11) for review on master by Niels de Vos (ndevos)

Comment 18 Worker Ant 2016-09-13 11:40:22 UTC
REVIEW: http://review.gluster.org/14701 (gfapi: redesign the public interface for upcall consumers) posted (#12) for review on master by Niels de Vos (ndevos)

Comment 19 Worker Ant 2016-09-15 06:11:49 UTC
REVIEW: http://review.gluster.org/14701 (gfapi: redesign the public interface for upcall consumers) posted (#13) for review on master by Niels de Vos (ndevos)

Comment 20 Worker Ant 2016-09-15 06:40:50 UTC
REVIEW: http://review.gluster.org/14701 (gfapi: redesign the public interface for upcall consumers) posted (#14) for review on master by Niels de Vos (ndevos)

Comment 21 Worker Ant 2016-09-18 08:16:09 UTC
REVIEW: http://review.gluster.org/14701 (gfapi: redesign the public interface for upcall consumers) posted (#15) for review on master by Niels de Vos (ndevos)

Comment 22 Worker Ant 2016-09-28 18:00:42 UTC
COMMIT: http://review.gluster.org/14701 committed in master by Niels de Vos (ndevos) 
------
commit 4721188a154acd9a0a4c096d8d73e97f3bf1b2a9
Author: Niels de Vos <ndevos>
Date:   Sat Aug 6 16:04:48 2016 +0200

    gfapi: redesign the public interface for upcall consumers
    
    The glfs_callback_arg and glfs_callback_inode_arg were allocated by
    gfapi, and expected to be free()'d by the application. However it is not
    reasonable to expect that applications use the same memory allocator to
    as the compiled libgfapi.so. For instance, it is possible that gfapi
    uses glibc malloc/free, and an application like NFS-Ganesha the versions
    from jemalloc. Mismatching of the malloc() and free() functions causes
    segmentation faults at best.
    
    In order to prevent problems like this in the future, the API for
    applications that consume upcalls has been remodeled. Any of the
    structures that gfapi allocates, should be free'd with glfs_free(). The
    members of the structures can not be accessed directly anymore, each
    has its own function to access now.
    
    Correcting the naming of the functions, structures and constants is a
    continuation of commit 2775dc64101ed37c8d9809bf9852dbf0746ee2b6. These
    new improvements not only have correct prefixes for the functions and
    structures, the naming also reflects more to the upcall framework and
    does not use "callback" anymore.
    
    Change-Id: I2b8bd5a0a82036d2abea1a217f5e5975a1d4fe93
    BUG: 1344714
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/14701
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Kaleb KEITHLEY <kkeithle>
    Reviewed-by: soumya k <skoduri>
    Reviewed-by: jiffin tony Thottan <jthottan>

Comment 23 Worker Ant 2016-10-17 10:01:34 UTC
REVIEW: http://review.gluster.org/15653 (gfapi: add glfs_free() to glfs.h) posted (#1) for review on master by Niels de Vos (ndevos)

Comment 24 Worker Ant 2016-10-17 11:06:40 UTC
REVIEW: http://review.gluster.org/15653 (gfapi: add glfs_free() to glfs.h) posted (#2) for review on master by Niels de Vos (ndevos)

Comment 25 Worker Ant 2016-10-17 19:49:40 UTC
REVIEW: http://review.gluster.org/15653 (gfapi: add glfs_free() to glfs.h) posted (#3) for review on master by soumya k (skoduri)

Comment 26 Worker Ant 2016-10-18 14:17:13 UTC
COMMIT: http://review.gluster.org/15653 committed in master by Jeff Darcy (jdarcy) 
------
commit 5ab0b43ce67d8d131242542a80b6aa6b129ed5ee
Author: Niels de Vos <ndevos>
Date:   Mon Oct 17 11:58:30 2016 +0200

    gfapi: add glfs_free() to glfs.h
    
    Commit 4721188a154acd9a0a4c096d8d73e97f3bf1b2a9 introduces glfs_free()
    but missed adding the function to the header. The symbol is correctly
    available in the library though. Testcases do not seem to fail when a
    function is missing for the headers...
    
    The glusterfs-3.7.16 packages have been released with the missing
    declaration in the header and symbol-maps. Still, the function is
    available for applications:
    
        $ objdump -T usr/lib64/libgfapi.so.0 | grep -w glfs_free
        0000000000006aa0 g    DF .text	0000000000000035  GFAPI_3.7.16 glfs_free
    
    Change-Id: Ia707ee957f090dbfca028192fcc81a83dfdf4ae0
    BUG: 1344714
    Reported-by: Jiffin Tony Thottan <jthottan>
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/15653
    CentOS-regression: Gluster Build System <jenkins.org>
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: jiffin tony Thottan <jthottan>
    NetBSD-regression: NetBSD Build System <jenkins.org>

Comment 27 Worker Ant 2016-11-01 15:19:56 UTC
REVIEW: http://review.gluster.org/15760 (gfapi/upcall: Fix mismatch in few upcall API SYMVER) posted (#1) for review on master by soumya k (skoduri)

Comment 28 Worker Ant 2016-11-03 18:18:51 UTC
COMMIT: http://review.gluster.org/15760 committed in master by Kaleb KEITHLEY (kkeithle) 
------
commit 5b453380b15f34c0841f453a02fdabc46ad2f7ef
Author: Soumya Koduri <skoduri>
Date:   Tue Nov 1 20:32:17 2016 +0530

    gfapi/upcall: Fix mismatch in few upcall API SYMVER
    
    There is mismatch in few of the upcall API routine
    definitions and their corresponding symbol version
    declarations. Fixed the same.
    
    Change-Id: I2edfd9546a4c6a9128757f3b68e3ae4edd2c7a79
    BUG: 1344714
    Signed-off-by: Soumya Koduri <skoduri>
    Reviewed-on: http://review.gluster.org/15760
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: jiffin tony Thottan <jthottan>
    Reviewed-by: Kaleb KEITHLEY <kkeithle>
    Tested-by: Kaleb KEITHLEY <kkeithle>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>

Comment 29 Shyamsundar 2017-03-06 17:20:39 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.