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

Bug 1138389

Summary: DHT :- rm -rf is not removing stale link file and because of that unable to create file having same name as stale link file
Product: [Community] GlusterFS Reporter: Shyamsundar <srangana>
Component: distributeAssignee: Shyamsundar <srangana>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.6.0CC: bugs, gluster-bugs, nsathyan, racpatel, spalai, ssamanta
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.6.0beta1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1117923 Environment:
Last Closed: 2014-11-11 08:38:08 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: 1117283, 1117923, 1139170, 1139992    
Bug Blocks: 1117822    

Description Shyamsundar 2014-09-04 17:17:18 UTC
+++ This bug was initially created as a clone of Bug #1117923 +++

Description of problem:
=======================
Sometimes rm -rf is not removing stale link find from all bricks and as a result of it user is unable to create file having same name as stale link file.


How reproducible:
=================
Intermittent 


Steps to Reproduce:
====================
1. create and mount distributed volume. (mount on multiple client)
2. create few files on mount point.
3. did multiple rename and once it was from multiple mount point.
4. from mount executed rm -rf *
5. try to create file after that.

[root@OVM1 snap]# ls -l
total 0

[root@OVM1 snap]# touch e6
[root@OVM1 snap]# `ls` >> e6
[root@OVM1 snap]# cat e6

[root@OVM1 snap]# echo "abc"  > e6
[root@OVM1 snap]# cat e6
cat: e6: No such file or directory
[root@OVM1 snap]# cat e6
cat: e6: Input/output error
[root@OVM1 snap]# ls -l e6
ls: cannot access e6: No such file or directory
[root@OVM1 snap]# ls -l
total 0

verified on bricks

brick:-
[root@OVM3 snap]# ls -l /brick2/*
/brick2/b1:
total 0
---------T 2 root root 0 Jul  7 20:33 e6

/brick2/b2:
total 0
---------T 2 root root 0 Jul  7 20:34 e6


/brick2/b3:
total 0


Actual results:
===============
due to old stale link file, unable to create file having same name


Expected results:
================
rm -rf should remove old stale link file and new file creation should not fail due to presence of old link file

--- Additional comment from Rachana Patel on 2014-07-08 08:48:15 EDT ---

volume name :- snap

mount info :-
mount  1:-
[root@OVM3 ~]# mount  | grep snap
10.70.35.198:/snap on /mnt/snap type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)

mount 2 :-
root@OVM1 ~]# mount | grep snap
10.70.35.198:/snap on /mnt/snap type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)

Comment 1 Anand Avati 2014-09-04 18:45:24 UTC
REVIEW: http://review.gluster.org/8602 (DHT/Create : Failing to identify a linkto file in lookup_everywhere_cbk path) posted (#1) for review on release-3.6 by Shyamsundar Ranganathan (srangana)

Comment 2 Anand Avati 2014-09-04 20:25:09 UTC
REVIEW: http://review.gluster.org/8602 (DHT/Create : Failing to identify a linkto file in lookup_everywhere_cbk path) posted (#2) for review on release-3.6 by Shyamsundar Ranganathan (srangana)

Comment 3 Anand Avati 2014-09-05 15:09:46 UTC
REVIEW: http://review.gluster.org/8602 (DHT/Create : Failing to identify a linkto file in lookup_everywhere_cbk path) posted (#3) for review on release-3.6 by Shyamsundar Ranganathan (srangana)

Comment 4 Anand Avati 2014-09-05 15:18:27 UTC
REVIEW: http://review.gluster.org/8602 (DHT/Create : Failing to identify a linkto file in lookup_everywhere_cbk path) posted (#4) for review on release-3.6 by Shyamsundar Ranganathan (srangana)

Comment 5 Anand Avati 2014-09-08 17:18:07 UTC
COMMIT: http://review.gluster.org/8602 committed in release-3.6 by Vijay Bellur (vbellur) 
------
commit 10aebe1c8be9ab87be233b4c4e6d94279864c461
Author: Susant Palai <spalai>
Date:   Thu Sep 4 13:55:54 2014 -0400

    DHT/Create : Failing to identify a linkto file in lookup_everywhere_cbk path
    
    In case a file is not found in its cached subvol we proceed with
    dht_lookup_everywhere. But as we dont add the linkto xattr to the
    dictionary, we fail to identify any linkto file encountered.The
    implication being we end up thinking the linkto file as a regular file
    and proceed with the fop.
    
    Change-Id: Iab02dc60e84bb1aeab49182f680c0631c33947e2
    BUG: 1138389
    Signed-off-by: Susant Palai <spalai>
    Reviewed-on-master: http://review.gluster.org/8277
    Reviewed-by: Vijay Bellur <vbellur>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-on: http://review.gluster.org/8602
    Reviewed-by: Jeff Darcy <jdarcy>

Comment 6 Niels de Vos 2014-09-22 12:45:40 UTC
A beta release for GlusterFS 3.6.0 has been released. Please verify if the release solves this bug report for you. In case the glusterfs-3.6.0beta1 release does not have a resolution for this issue, leave a comment in this bug and move the status to ASSIGNED. If this release fixes the problem for you, leave a note and change the status to VERIFIED.

Packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update (possibly an "updates-testing" repository) infrastructure for your distribution.

[1] http://supercolony.gluster.org/pipermail/gluster-users/2014-September/018836.html
[2] http://supercolony.gluster.org/pipermail/gluster-users/

Comment 7 Niels de Vos 2014-11-11 08:38:08 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.6.1, please reopen this bug report.

glusterfs-3.6.1 has been announced [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://supercolony.gluster.org/pipermail/gluster-users/2014-November/019410.html
[2] http://supercolony.gluster.org/mailman/listinfo/gluster-users