Bug 1345828 - SAMBA-DHT : Rename ends up creates nested directories with same gfid
Summary: SAMBA-DHT : Rename ends up creates nested directories with same gfid
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: distribute
Version: rhgs-3.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: RHGS 3.4.0
Assignee: Raghavendra G
QA Contact: Vivek Das
Whiteboard: dht-samba, dht-rca-unknown, dht-renam...
Depends On: 1118770 1369312
Blocks: 1503134
TreeView+ depends on / blocked
Reported: 2016-06-13 09:30 UTC by Vivek Das
Modified: 2018-09-23 15:06 UTC (History)
8 users (show)

Fixed In Version: glusterfs-3.12.2-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-09-04 06:29:40 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:2607 0 None None None 2018-09-04 06:31:22 UTC

Description Vivek Das 2016-06-13 09:30:40 UTC
Description of problem:

This bug is with reference to https://bugzilla.redhat.com/show_bug.cgi?id=1345732.

When we try renaming a directory it ends up creating a nested directory of the same gfid.

With an existing distribute replicate volume with samba ctdb setup and VSS plugin. On a cifs mount when any directory say "xyz" is renamed to ".xyz" it is observed that it ends up creating "xyz/.xyz"

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

How reproducible:

Steps to Reproduce:
1.In an existing setup with Distributed-Replicate volume with samba-ctdb setup and VSS plugins
2.Do a cifs mount and mount the share in windows8 as well
3.Create files,directories in the share.
3.Play a video file (not necessarily from the same directory which will be renamed in the below steps)
4.goto cifs mount rename any directory containing files say "xyz" to ".xyz"
5.Goto windows share right click on "xyz" properties and check the Hidden checkbox.
6.Goto the cifs mount location and rename again ".xyz" to "xyz"
7.Double click on "xyz"

Actual results:
Share was not accessible.The video which was being played crashed in mid way.

Expected results:
Should not be any issue

Additional info:

Comment 3 Poornima G 2016-06-13 09:51:33 UTC
Findings on inode link failure:

The rename command "mv samba2 .samba2" ends up creating samba2/.samba2 directory structure, both samba2 and .samba2 having same gfid. This could be because of a known race in rename in dht, Raghavendra G will update on this.

Below is the backend details when we end up in this scenario.

All the bricks have a .samba2 directory created inside samba2:
# ll -R /bricks/brick2/DOG_brick?/samba2 -a
drwxr-xr-x. 2 root root   6 Jun 13 04:35 .samba2

GFIDs of both the directories are same:
# getfattr -e hex -dm - /bricks/brick2/DOG_brick0/samba2
getfattr: Removing leading '/' from absolute path names
# file: bricks/brick2/DOG_brick0/samba2

# getfattr -e hex -dm - /bricks/brick2/DOG_brick0/samba2/.samba2
getfattr: Removing leading '/' from absolute path names
# file: bricks/brick2/DOG_brick0/samba2/.samba2

# ll /bricks/brick2/DOG_brick3/.glusterfs/40/8e/
total 0
lrwxrwxrwx. 1 root root 55 Jun  7 10:45 408e7032-cc0f-479f-a450-b17302802adf -> ../../00/00/00000000-0000-0000-0000-000000000001/samba2

A lookup is issued by fuse on /samba2/.samba2, dht_lookup_dir_cbk() --> dht_selfheal_directory() --> inode_link() is called, inode detects that there is a cyclic loop in the dentry and hence returns error.

Comment 4 Raghavendra G 2017-01-31 04:32:27 UTC
We have known issues related to rename and lookup heal race like bz 1118770. Consider following scenario during mv samba2 .samba2 (which is the first rename above):

1. rename was successful on some subvols of DHT but not on all.
2. A lookup on samba2 was issued and this results in healing of samba2 on those subvols where rename is yet to be issued.
3. rename completes and say a lookup on samba2 was issued again. At the end of this we've samba2 and .samba2 on all subvols (both having same gfid).

Now a second mv .samba2 samba2 can create a directory samba2/.samba2

Comment 5 ankit 2017-02-21 05:50:21 UTC
Tried to reproduce this bug on

gluster v3.8.4-12
Samba version 4.5.5

There were no crashing of video as stated above after renaming operation. 
This bug should be closed.

Comment 8 Vivek Das 2018-05-05 15:01:45 UTC

Followed the steps to reproduce and the issue is not seen in the above version.

Comment 10 errata-xmlrpc 2018-09-04 06:29:40 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.


Note You need to log in before you can comment on or make changes to this bug.