Bug 1423385 - 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: libglusterfsclient
Version: 3.10
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Poornima G
QA Contact:
URL:
Whiteboard:
: 1423065 (view as bug list)
Depends On: 1423373
Blocks: glusterfs-3.10.0
TreeView+ depends on / blocked
 
Reported: 2017-02-17 08:18 UTC by Poornima G
Modified: 2017-03-06 17:46 UTC (History)
2 users (show)

Fixed In Version: glusterfs-3.10.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1423373
Environment:
Last Closed: 2017-02-27 15:29:38 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Poornima G 2017-02-17 08:18:28 UTC
+++ This bug was initially created as a clone of Bug #1423373 +++

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:

--- Additional comment from Worker Ant on 2017-02-17 03:17:16 EST ---

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 1 Worker Ant 2017-02-17 08:19:13 UTC
REVIEW: https://review.gluster.org/16655 (libglusterfs: Fix a crash due to race between inode_ctx_set and inode_ref) posted (#1) for review on release-3.10 by Poornima G (pgurusid)

Comment 2 Shyamsundar 2017-02-20 02:57:51 UTC
*** Bug 1423065 has been marked as a duplicate of this bug. ***

Comment 3 Worker Ant 2017-02-20 07:03:53 UTC
REVIEW: https://review.gluster.org/16655 (libglusterfs: Fix a crash due to race between inode_ctx_set and inode_ref) posted (#2) for review on release-3.10 by Poornima G (pgurusid)

Comment 4 Worker Ant 2017-02-20 12:25:33 UTC
COMMIT: https://review.gluster.org/16655 committed in release-3.10 by Shyamsundar Ranganathan (srangana) 
------
commit d10c5375b33520f36fd6acbd47b617d43f529ca2
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 guarded by inode_table->lock, and
    inode_ctx is guarded 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
    
    > 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>
    
    Change-Id: I1bfe111c211fcc4fcd761bba01dc87c4c69b5170
    BUG: 1423385
    Signed-off-by: Poornima G <pgurusid>
    Reviewed-on: https://review.gluster.org/16655
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Shyamsundar Ranganathan <srangana>

Comment 5 Shyamsundar 2017-02-27 15:29:38 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-devel/2017-February/052173.html
[2] https://www.gluster.org/pipermail/gluster-users/

Comment 6 Shyamsundar 2017-03-06 17:46:38 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.