Bug 1024459

Summary: Unable to create hardlinks when the source and destination are in the same directory.
Product: Red Hat Gluster Storage Reporter: Ben Turner <bturner>
Component: glusterfsAssignee: Vijaikumar Mallikarjuna <vmallika>
Status: CLOSED ERRATA QA Contact: Ben Turner <bturner>
Severity: high Docs Contact:
Priority: high    
Version: 2.1CC: nsathyan, psriniva, rhinduja, sasundar, smohan, ssamanta, vagarwal, vbellur, vmallika
Target Milestone: ---   
Target Release: RHGS 3.0.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.6.0-3.0.el6rhs Doc Type: Bug Fix
Doc Text:
Previously creating a hard link where the source and destination files were in the same directory failed in the first attempt. With this fix, hard link creation is successful in the first attempt.
Story Points: ---
Clone Of:
: 1030208 (view as bug list) Environment:
Last Closed: 2014-09-22 19:29:18 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:
Bug Depends On:    
Bug Blocks: 1030208    

Description Ben Turner 2013-10-29 17:05:22 UTC
Description of problem:

When I try to create a hard link where the source file and the hard link are in the same directory I get:

[root@gqac031 gluster-mount]# ln link-source link-destiantion2
ln: creating hard link `link-destiantion2' => `link-source': No such file or directory

If I run the exact command again it is successful:

[root@gqac031 gluster-mount]# ln link-source link-destiantion2
[root@gqac031 gluster-mount]# sh link-destiantion2
Hello World       
[root@gqac031 gluster-mount]# cat link-source 
#!/bin/bash
echo Hello World

If I create a hardlink where the source and the hard link are not in the same dir it is successful on the first try:

[root@gqac031 gluster-mount]# ln hardlinks-sources/100.sh hardlinks-destination/test
[root@gqac031 gluster-mount]# ll hardlinks-destination/test
-rw-r--r-- 3 root root 29 Oct 29 12:26 hardlinks-destination/test
[root@gqac031 gluster-mount]# cat hardlinks-sources/100.sh
#!/bin/bash
echo Hello World
[root@gqac031 gluster-mount]# sh hardlinks-destination/test
Hello World

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

glusterfs-3.4.0.33rhs-1.el6.x86_64

How reproducible:

Every time I tried.

Steps to Reproduce:
1.  Create a hard link where the source and hard link are in the same directory.
2.
3.

Actual results:

[root@gqac031 gluster-mount]# ln link-source link-destiantion2
ln: creating hard link `link-destiantion2' => `link-source': No such file or directory

Expected results:

The hard link is successful on the first try.

Additional info:

Comment 2 Ben Turner 2013-10-29 17:50:33 UTC
I tested this on a 1x2 volume:

Volume Name: healtest
Type: Replicate
Volume ID: 089aad16-3b59-4f65-840b-03d5c4913555
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: gqac016.sbu.lab.eng.bos.redhat.com:/bricks/healtest_brick0
Brick2: qe-blade-03.idm.lab.bos.redhat.com:/bricks/healtest_brick1

Comment 3 Vijaikumar Mallikarjuna 2013-12-26 08:59:58 UTC
Patch: https://code.engineering.redhat.com/gerrit/#/c/16181/

Comment 4 Vijaikumar Mallikarjuna 2014-03-13 08:47:19 UTC
*** Bug 1059677 has been marked as a duplicate of this bug. ***

Comment 5 Vivek Agarwal 2014-05-22 11:52:17 UTC
Merged as a part of rebase

Comment 6 Ben Turner 2014-06-09 20:37:49 UTC
Verified on glusterfs-3.6.0.14-1.el6rhs.x86_64.

Comment 7 Pavithra 2014-08-06 10:39:28 UTC
Hi Vijaikumar,

Please review the edited doc text for technical accuracy and sign off.

Comment 8 Vijaikumar Mallikarjuna 2014-08-07 05:10:14 UTC
Doc text looks good to me

Comment 10 errata-xmlrpc 2014-09-22 19:29:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-1278.html