Bug 1211913

Summary: nfs : racy condition in export/netgroup feature
Product: [Community] GlusterFS Reporter: Jiffin <jthottan>
Component: nfsAssignee: Jiffin <jthottan>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, gluster-bugs, ndevos
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.8rc2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1212182 (view as bug list) Environment:
Last Closed: 2016-06-16 12:51:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1212182    
Attachments:
Description Flags
core file none

Description Jiffin 2015-04-15 08:40:49 UTC
Created attachment 1014624 [details]
core file

Description of problem:

For export/netgroup feature we will run a thread in background which will fetch/refresh contents of export/netgroup file. This thread is not cleaned up properly

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

How reproducible:
rarely


Actual results:
coredump is generated.

Expected results:
Should reach such race conditions

Additional info:

Comment 1 Anand Avati 2015-04-15 08:43:56 UTC
REVIEW: http://review.gluster.org/10250 (nfs : fix for coredump caused by export/netgroup feature in th regression failure) posted (#1) for review on master by jiffin tony Thottan (jthottan)

Comment 2 Anand Avati 2015-04-15 08:45:34 UTC
REVIEW: http://review.gluster.org/10250 (nfs : fix for coredump caused by export/netgroup feature in the regression failure) posted (#2) for review on master by Humble Devassy Chirammal (humble.devassy)

Comment 3 Anand Avati 2015-04-20 17:54:06 UTC
REVIEW: http://review.gluster.org/10250 (nfs : fix for coredump caused by export/netgroup feature in the regression failure) posted (#3) for review on master by Vijay Bellur (vbellur)

Comment 4 Niels de Vos 2015-04-20 19:05:27 UTC
From my understanding and talking to Jiffin, the refresh-thread is active while the nfs-server is exiting. This causes a (partial) cleanup of some of the structures, which are later on accessed again, resulting in the segfault.

I see two options to fix this permanently, but need to look into the details to judge what fix is most reasonable:

1. replace the dict_t structures by rcu-lists
2. lock the structures while the refresh thread is running and stop the thread 
   (+wait) on shutting down the nfs-server

Comment 5 Anand Avati 2015-05-05 06:09:40 UTC
REVIEW: http://review.gluster.org/10250 (nfs : fix for coredump caused by export/netgroup feature in the regression failure) posted (#4) for review on master by jiffin tony Thottan (jthottan)

Comment 6 Anand Avati 2015-05-05 06:10:32 UTC
REVIEW: http://review.gluster.org/10250 (nfs : fix for coredump caused by export/netgroup feature in the regression) posted (#5) for review on master by jiffin tony Thottan (jthottan)

Comment 7 Anand Avati 2015-05-05 10:40:58 UTC
REVIEW: http://review.gluster.org/10250 (nfs : fix for coredump caused by export/netgroup feature in the regression) posted (#6) for review on master by Vijay Bellur (vbellur)

Comment 8 Nagaprasad Sathyanarayana 2015-10-25 14:53:58 UTC
Fix for this bug is already made in a GlusterFS release. The cloned BZ has details of the fix and the release. Hence closing this mainline BZ.

Comment 9 Nagaprasad Sathyanarayana 2015-10-25 15:13:36 UTC
Fix for this BZ is already present in a GlusterFS release. You can find clone of this BZ, fixed in a GlusterFS release and closed. Hence closing this mainline BZ as well.

Comment 10 Niels de Vos 2016-06-16 12:51: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.8.0, please open a new bug report.

glusterfs-3.8.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://blog.gluster.org/2016/06/glusterfs-3-8-released/
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user