[Bugs] [Bug 1785094] rename dir1 to another existing dir2 cause dir1 glusterfa link file deleted
bugzilla at redhat.com
bugzilla at redhat.com
Fri Dec 20 07:52:25 UTC 2019
https://bugzilla.redhat.com/show_bug.cgi?id=1785094
--- Comment #1 from zhou lin <zz.sh.cynthia at gmail.com> ---
This problem is permanent. From my investigation, for both glusterfs3.12.15 and
glusterfs7.0 the root cause seems to be the posix_rename of glusterfsd side
firstly unlink the glusterfs link (in posix_handle_unset) and then it fails in
sys_rename(since the target already exists), then it does not restore the
glusterfs link( file link 1d6febd3-875c-4879-a370-c4828e0052c3 in
.glusterfs/1d/6f directory). I think the correct practice should be either
restore the deleted glusterfs link file after sys_rename fail or change to
firstly call sys_rename then delete the glusterfs link( I test this and seems
with my code change this problem is gone).
I would like your opinion on this issue, this issue is permanent, you can
try in your own env. Thanks!
following is the reproduce steps:
1> Mkdir dir1 dir2
2> Touch some files in both dir1 and dir2
3> Rename dir1 dir2 * //this will fail with “rename: dir1: rename to dir2
failed: Directory not empty”
4> Check the glusterfs link file in
.glusterfs/xx/xx/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx this file will disappear
5> Ls dir1 when dht is enabled in glusterfs3.12 ls command fails to show
dir1 contents
enclosed is my test patch, with my patch there is no such issue.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
More information about the Bugs
mailing list