Re: mkdir race condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Emmanuel Dreyfus <manu@xxxxxxxxxx> wrote:

> On a replicated volume, mkdir quickly followed by the rename of a new
> directory child fails. 
> 
> # rm -Rf test && mkdir test && touch test/a && mv test/a test/b
> mv: rename test/a to test/b: No such file or directory
> # rm -Rf test && mkdir test && sleep 1 && touch test/a && mv test/a test/b
> (it works)

I just reinstalled server from release-3.3 and now things make more
sense. Any directory creation will report failure but will succeed:

bacasel# mkdir /gfs/manu
mkdir: /gfs/manu: No such file or directory
bacasel# cd /gfs
bacasel# ls
manu

Server log reports it fails because:
[2012-05-20 07:59:23.775789] E
[posix-handle.c:412:posix_handle_mkdir_hashes] 0-pfs-posix: error mkdir
hash-1 /export/wd3a/.glusterfs/ec/e2 (No such file or directory)

It seems posix_handle_mkdir_hashes() attempts to mkdir two directories
at once: ec/ec2. How is it supposed to work? Should parent directory be
created somewhere else?


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@xxxxxxxxxx



[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux