Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 990089

Summary: do not unlink the gfid handle upon last unlink without checking for open fds
Product: [Community] GlusterFS Reporter: Raghavendra Bhat <rabhat>
Component: fuseAssignee: Raghavendra Bhat <rabhat>
Status: CLOSED EOL QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, gluster-bugs, rgowdapp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-22 15:46:38 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:

Description Raghavendra Bhat 2013-07-30 11:16:06 UTC
Description of problem:

As of now, any fd based operations fail with EBADFD, if after the last unlink of the file a graph change is done.

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


How reproducible:
Always


Steps to Reproduce:
1. create a volume, start it and mount it.
2. Create a file
3. Open the file
4. Unlink the file
5. do a graph change (some performance xlators on/off)
6. Try to write to the fd opened

Actual results:
The write operations fail with EBADFD

Expected results:
Write operations should succeed

Additional info:

Reason:
Upon the unlink of the file (in fact upon the removal of the last hard link for the file) the gfid handle from the .glusterfs directory in the brick is removed. Now,upon the graph change, the client process cannot find the inode for the fd in the new graph. So to get the inode, it does a nameless lookup using the gfid (which gets the inode by getting the information from the gfid handle present in the .glusterfs directory). But since the gfid handle has been removed, the new inode cannot be obtained, and the fd is marker as bad.

To handle it, the gfid handle should be removed upon the removal of the last reference to the file (i.e there should not be any open fds and should not be any entries in the filesystem).

Comment 1 Anand Avati 2013-07-30 11:19:46 UTC
REVIEW: http://review.gluster.org/5428 (storage/posix: remove the gfid handle only when the last reference in removed) posted (#1) for review on master by Raghavendra Bhat (raghavendra)

Comment 2 Anand Avati 2013-07-30 18:53:49 UTC
REVIEW: http://review.gluster.org/5428 (storage/posix: remove the gfid handle only when the last reference in removed) posted (#2) for review on master by Raghavendra Bhat (raghavendra)

Comment 3 Anand Avati 2013-08-22 12:47:15 UTC
REVIEW: http://review.gluster.org/5428 (storage/posix: remove the gfid handle only when the last reference in removed) posted (#3) for review on master by Raghavendra Bhat (raghavendra)

Comment 4 Anand Avati 2013-08-26 12:13:25 UTC
REVIEW: http://review.gluster.org/5428 (storage/posix: remove the gfid handle only when the last reference in removed) posted (#4) for review on master by Raghavendra Bhat (raghavendra)

Comment 5 Anand Avati 2013-12-12 11:44:24 UTC
REVIEW: http://review.gluster.org/5428 (storage/posix: remove the gfid handle only when the last reference in removed) posted (#5) for review on master by Raghavendra Bhat (raghavendra)

Comment 6 Raghavendra G 2015-09-04 08:51:40 UTC
*** Bug 1259995 has been marked as a duplicate of this bug. ***

Comment 7 Kaleb KEITHLEY 2015-10-22 15:46:38 UTC
because of the large number of bugs filed against mainline version\ is ambiguous and about to be removed as a choice.

If you believe this is still a bug, please change the status back to NEW and choose the appropriate, applicable version for it.