rename(2) race condition

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

 



After I patched to fix the mkdir issue, I now encounter a race in
rename(2). Most of the time it works, but sometimes:

  3548      1 tar      CALL  open(0xbb9010e0,0xa02,0x180)
  3548      1 tar      NAMI  "usr/src/gnu/CVS/Tag.03548f"
  3548      1 tar      RET   open 8
  3548      1 tar      CALL  __fstat50(8,0xbfbfe69c)
  3548      1 tar      RET   __fstat50 0
  3548      1 tar      CALL  write(8,0x8067880,0x16)
  3548      1 tar      GIO   fd 8 wrote 22 bytes
       "Nnetbsd-5-1-2-RELEASE\n"
  3548      1 tar      RET   write 22/0x16
  3548      1 tar      CALL  close(8)
  3548      1 tar      RET   close 0
  3548      1 tar      CALL  lchmod(0xbb9010e0,0x1a4)
  3548      1 tar      NAMI  "usr/src/gnu/CVS/Tag.03548f"
  3548      1 tar      RET   lchmod 0
  3548      1 tar      CALL  __lutimes50(0xbb9010e0,0xbfbfe6d8)
  3548      1 tar      NAMI  "usr/src/gnu/CVS/Tag.03548f"
  3548      1 tar      RET   __lutimes50 0
  3548      1 tar      CALL  rename(0xbb9010e0,0x8071584)
  3548      1 tar      NAMI  "usr/src/gnu/CVS/Tag.03548f"
  3548      1 tar      RET   rename -1 errno 13 Permission denied

I can reproduce it with the command below. It runs fine for a few
seconds and then hit permission denied. It needs a level of hierarchy to
exhibit the hebavior: just install a b will not fail.

mkdir test && echo "xxx" > tmp/a 
while [ 1 ] ; do rm -f test/b && install test/a test/b ; done

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