Bug 1423373 - Crash in index xlator because of race in inode_ctx_set and inode_ref
Summary: Crash in index xlator because of race in inode_ctx_set and inode_ref
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: core
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Poornima G
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1423385
TreeView+ depends on / blocked
 
Reported: 2017-02-17 07:09 UTC by Poornima G
Modified: 2017-05-30 18:44 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.11.0
Clone Of:
: 1423385 (view as bug list)
Environment:
Last Closed: 2017-05-30 18:44:10 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Poornima G 2017-02-17 07:09:26 UTC
Description of problem:
Some regression test cases in afr were failing because of this bug.

RCA:
    Currently inode ref count is gaurded by inode_table->lock, and
    inode_ctx is gauarded by inode->lock. With the new patch [1]
    inode_ref was modified to change the inode_ctx to track the ref
    count per xlator. Thus inode_ref performed under inode_table->lock
    is modifying inode_ctx which has to be modified only under inode->lock

Solution:
    When a inode is created, inode_ctx holder is allocated for all the xlators.
    Hence in case of inode_ctx_set instead of using the first free index in
    inode ctx holder, we can have predecided index for every xlator in the graph.



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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Worker Ant 2017-02-17 08:17:16 UTC
REVIEW: https://review.gluster.org/16622 (libglusterfs: Fix a crash due to race between inode_ctx_set and inode_ref) posted (#4) for review on master by Poornima G (pgurusid)

Comment 2 Worker Ant 2017-02-20 03:26:18 UTC
COMMIT: https://review.gluster.org/16622 committed in master by Pranith Kumar Karampuri (pkarampu) 
------
commit 4badd7334d345b1c27f528140e4c28afaf1f32f6
Author: Poornima G <pgurusid>
Date:   Wed Feb 15 11:18:31 2017 +0530

    libglusterfs: Fix a crash due to race between inode_ctx_set and inode_ref
    
    Issue:
    Currently inode ref count is gaurded by inode_table->lock, and
    inode_ctx is gauarded by inode->lock. With the new patch [1]
    inode_ref was modified to change the inode_ctx to track the ref
    count per xlator. Thus inode_ref performed under inode_table->lock
    is modifying inode_ctx which has to be modified only under inode->lock
    
    Solution:
    When a inode is created, inode_ctx holder is allocated for all the xlators.
    Hence in case of inode_ctx_set instead of using the first free index in
    inode ctx holder, we can have predecided index for every xlator in the graph.
    
    Credits Pranith K <pkarampu>
    
    [1] http://review.gluster.org/13736
    
    Change-Id: I1bfe111c211fcc4fcd761bba01dc87c4c69b5170
    BUG: 1423373
    Signed-off-by: Poornima G <pgurusid>
    Reviewed-on: https://review.gluster.org/16622
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Niels de Vos <ndevos>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu>

Comment 3 Shyamsundar 2017-05-30 18:44:10 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.11.0, please open a new bug report.

glusterfs-3.11.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/announce/2017-May/000073.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.