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

Bug 1412916

Summary: [ganesha+ec]: Contents of original file are not seen when hardlink is created
Product: [Community] GlusterFS Reporter: Pranith Kumar K <pkarampu>
Component: disperseAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.8CC: aloganat, amukherj, aspandey, bugs, dang, ffilz, jthottan, mbenjamin, nchilaka, pgurusid, pkarampu, rcyriac, rhinduja, rhs-bugs, skoduri, storage-qa-internal
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.8.9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1409730 Environment:
Last Closed: 2017-02-20 12:33:40 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: 1409730, 1413057    
Bug Blocks: 1408836    

Comment 1 Pranith Kumar K 2017-01-13 06:18:07 UTC
Steps to Reproduce:
1. Create ganesha cluster and create 2*(4+2) EC volume.
2. Enable nfs-ganesha on the volume with mdcache settings.
3. Mount the volume.
4. Create a file and write contents to it.
5. Create hard link to that file.
6. Read the contents of the file.

Actual results:
Contents of original file are not seen when hardlink is created

Expected results:
Contents should not get removed

Additional info:

[root@dhcp47-49 ec_test]# echo "testfile" > test1
[root@dhcp47-49 ec_test]# cat test1
testfile
[root@dhcp47-49 ec_test]# ls -lhrtia test1
10548474259765385418 -rw-r--r--. 1 root root 9 Dec 27 20:38 test1
[root@dhcp47-49 ec_test]# ln test1 test1_hlink
[root@dhcp47-49 ec_test]# ls -lhrtia test1 test1_hlink
10548474259765385418 -rw-r--r--. 2 root root 0 Dec 27 20:38 test1_hlink
10548474259765385418 -rw-r--r--. 2 root root 0 Dec 27 20:38 test1
[root@dhcp47-49 ec_test]# cat test1
[root@dhcp47-49 ec_test]# cat test1_hlink
[root@dhcp47-49 ec_test]# 
[root@dhcp47-49 ec_test]# 
[root@dhcp47-49 ec_test]# cat test1
[root@dhcp47-49 ec_test]# cat test1_hlink
[root@dhcp47-49 ec_test]# cat test1
[root@dhcp47-49 ec_test]# cat test1

Comment 2 Worker Ant 2017-01-13 06:25:41 UTC
REVIEW: http://review.gluster.org/16391 (cluster/ec: Do lookup on an existing file in link) posted (#1) for review on release-3.8 by Pranith Kumar Karampuri (pkarampu)

Comment 3 Worker Ant 2017-01-13 12:37:53 UTC
COMMIT: http://review.gluster.org/16391 committed in release-3.8 by Pranith Kumar Karampuri (pkarampu) 
------
commit 4d529702fa0f3e619f78fbbbbf3b1b819996a354
Author: Pranith Kumar K <pkarampu>
Date:   Wed Jan 4 13:37:23 2017 +0530

    cluster/ec: Do lookup on an existing file in link
    
    Problem:
    In link fop lookup is happening on the new fop which doesn't exist so the iatt
    ec serves parent xlators has size as zero which leads to 'cat' giving empty output
    
    Fix:
    Change code so that lookup happens on the existing link instead.
    
     >BUG: 1409730
     >Change-Id: I70eb02fe0633e61d1d110575589cc2dbe5235d76
     >Signed-off-by: Pranith Kumar K <pkarampu>
     >Reviewed-on: http://review.gluster.org/16320
     >Smoke: Gluster Build System <jenkins.org>
     >Reviewed-by: Xavier Hernandez <xhernandez>
     >Tested-by: Xavier Hernandez <xhernandez>
     >CentOS-regression: Gluster Build System <jenkins.org>
     >NetBSD-regression: NetBSD Build System <jenkins.org>
    
    BUG: 1412916
    Change-Id: I7079f1adbf5c402d1eb6eb9fe8badf8e17e475a4
    Signed-off-by: Pranith Kumar K <pkarampu>
    Reviewed-on: http://review.gluster.org/16391
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: Xavier Hernandez <xhernandez>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>

Comment 4 Niels de Vos 2017-02-20 12:33:40 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.9, please open a new bug report.

glusterfs-3.8.9 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] https://lists.gluster.org/pipermail/announce/2017-February/000066.html
[2] https://www.gluster.org/pipermail/gluster-users/