Hello,
I'm using the Samba server 3.0.33 that exports volume from a GPFS. The GPFS
strongly dislikes unlinking files that are locked (resulting in permission
denied) using fcntl F_SETLEASE.
It seems that the Samba *sometimes* tries to unlink a file that is oplocked.
Why? Is this a bug? Why it does not happen always but only sometimes? I have
strace logs showing:
Wrong case:
8711 14:57:50.765677
open("Y_odloz/D8/D8_03_Ivet_98/06aa6459-a011-40f8-bfb1-25d15e7ada61",
O_RDWR|O_CREAT|O_EXCL, 0744) = 121
8711 14:57:50.766030 fstat(121, {st_dev=makedev(0, 23), st_ino=3079419,
st_mode=S_IFREG|0744, st_nlink=1, st_uid=40022, st_gid=400, st_blksize=262144,
st_blocks=0, st_size=0, st_atime=2010/07/13-14:57:50,
st_mtime=2010/07/13-14:57:50, st_ctime=2010/07/13-14:57:50}) = 0
8711 14:57:50.766129 fcntl(12, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET,
start=8260, len=1}) = 0
8711 14:57:50.766214 fcntl(121, F_SETSIG, 0x23) = 0
8711 14:57:50.766275 fcntl(121, F_SETLEASE, 0x1) = 0
[...]
8711 14:57:50.789570
stat("Y_odloz/D8/D8_03_Ivet_98/06aa6459-a011-40f8-bfb1-25d15e7ada61",
{st_dev=makedev(0, 23), st_ino=3079419, st_mode=S_IFREG|0744, st_nlink=1,
st_uid=40022, st_gid=400, st_blksize=262144, st_blocks=0, st_size=0,
st_atime=2010/07/13-14:57:50, st_mtime=2010/07/13-14:57:50,
st_ctime=2010/07/13-14:57:50}) = 0
8711 14:57:50.789685
unlink("Y_odloz/D8/D8_03_Ivet_98/06aa6459-a011-40f8-bfb1-25d15e7ada61")
= -1 EACCES (Permission denied)
[...]
8711 14:58:20.785599 fcntl(121, F_SETSIG, 0x23) = 0
8711 14:58:20.785660 fcntl(121, F_SETLEASE, 0x2) = 0
8711 14:58:20.785736 close(121) = 0
Correct case:
8711 15:02:01.279971
open("Y_odloz/D8/D8_03_Ivet_98/0720d2bf-8619-4ecb-a2eb-d2b806941539",
O_RDWR|O_CREAT|O_EXCL, 0744) = 166
8711 15:02:01.333073 fstat(166, {st_dev=makedev(0, 23), st_ino=3164278,
st_mode=S_IFREG|0744, st_nlink=1, st_uid=40022, st_gid=400, st_blksize=262144,
st_blocks=0, st_size=0, st_atime=2010/07/13-15:02:01,
st_mtime=2010/07/13-15:02:01, st_ctime=2010/07/13-15:02:01}) = 0
8711 15:02:01.333221 fcntl(12, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET,
start=24956, len=1}) = 0
8711 15:02:01.333309 fcntl(166, F_SETSIG, 0x23) = 0
8711 15:02:01.333371 fcntl(166, F_SETLEASE, 0x1) = 0
[...]
8711 15:02:01.424660 fcntl(166, F_SETSIG, 0x23) = 0
8711 15:02:01.424734 fcntl(166, F_SETLEASE, 0x2) = 0
[...]
8711 15:02:01.513181
stat("Y_odloz/D8/D8_03_Ivet_98/0720d2bf-8619-4ecb-a2eb-d2b806941539",
{st_dev=makedev(0, 23), st_ino=3164278, st_mode=S_IFREG|0744, st_nlink=1,
st_uid=40022, st_gid=400, st_blksize=262144, st_blocks=0, st_size=0,
st_atime=2010/07/13-15:02:01, st_mtime=2010/07/13-15:02:01,
st_ctime=2010/07/13-15:02:01}) = 0
8711 15:02:01.513393
unlink("Y_odloz/D8/D8_03_Ivet_98/0720d2bf-8619-4ecb-a2eb-d2b806941539")
= 0
[...]
8711 15:02:01.514906 fcntl(12, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET,
start=24956, len=1}) = 0
8711 15:02:01.515005 close(166) = 0
--
Luk?? Hejtm?nek