[Bugs] [Bug 1296825] New: Inconsistency occurs by combination of copying, moving and removing a directory.

bugzilla at redhat.com bugzilla at redhat.com
Fri Jan 8 08:45:04 UTC 2016


https://bugzilla.redhat.com/show_bug.cgi?id=1296825

            Bug ID: 1296825
           Summary: Inconsistency occurs by combination of copying, moving
                    and removing a directory.
           Product: GlusterFS
           Version: 3.7.6
         Component: unclassified
          Severity: high
          Assignee: bugs at gluster.org
          Reporter: comboy999jdl at gmail.com
                CC: bugs at gluster.org, gluster-bugs at redhat.com



Description of problem:
=======================
Inconsistency occurs by combination of copying, moving and removing a
directory.


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

How reproducible:
=================
About once in 100-3000 times.


Steps to Reproduce:
===================
1. create a non-empty directory dir.
  1-1. mkdir dir
  1-2. touch dir/file
2. create a copy of dir, swap dir with copy and clean up.
  2-1. mkdir work
  2-2. cp -a dir work/copy
  2-3. mv dir work/orig
  2-4. mv work/copy dir
  2-5. rm -rf work
3. repeat 2.

## Reproducible shell script ##
#!/bin/sh
# Suppose /data is on the glusterfs.
SRC_DIR=/data/tmp/dir
WORK_DIR=/data/tmp/work
mkdir $SRC_DIR
for((I=1;I<=1;I++));do
  touch $SRC_DIR/file$I
done

for((N=0;N<=100000;N++));do
  echo $N
  mkdir $WORK_DIR || break
  cp -a $SRC_DIR $WORK_DIR/copy || break
  mv $SRC_DIR $WORK_DIR/dir || break
  mv $WORK_DIR/copy $SRC_DIR || break
  rm -rf $WORK_DIR || break
done
## end of script ##


Actual results:
===============
The script stops with rm -rf command error "rm: cannot remove 
`/data/tmp/work/dir': Directory not empty".
But /data/tmp/work/dir is empty.

And a waring is registered in 
/var/log/glusterfs/bricks/gluster-brick1-gv0.log
W [MSGID: 113026] [posix.c:1338:posix_mkdir] 0-gv0-posix: mkdir (/tmp/dir): 
gfid (3cdbdb99-07c4-4add-a742-2b112c393305) isalready associated with 
directory 
(/gluster/brick1/gv0/.glusterfs/f1/d5/f1d5d265-d857-4a56-8c4d-7fa46cbd86a8/dir). 
Hence,both directories will share same gfid and thiscan lead to 
inconsistencies.

Actutually Brick1 differs from Brick2.

Contents of Brick1 sv1:/gluster/brick1/gv0/tmp/work/dir/ are:
>file

Contents of Brick2 sv2:/gluster/brick1/gv0/tmp/work/dir/ are:
>copy
>copy/file


Expected results:
=================
No error occurs.


Additional info:
================
Gluster volume settings are default.
## gluster volume info output ##
Volume Name: gv0
Type: Replicate
Volume ID: ea926ec7-95af-4b2d-8a1e-f37951b733c5
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: sv1:/gluster/brick1/gv0
Brick2: sv2:/gluster/brick1/gv0
Options Reconfigured:
features.quota-deem-statfs: on
performance.readdir-ahead: on
features.quota: on
features.inode-quota: on

-- 
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