[Samba] Re: locks cooperating with a server side process

Chris Green cmg at dok.org
Tue Jul 20 19:52:01 GMT 2004


Chris Green <cmg at dok.org> writes:

> I'm having a problem where I can gain the lock but the process is
> still writing to the file.

OK, I realized that putting python in might have scared away anyone
that knew C enough to help me out on my problem so I wrote a tiny
util to look at the fcntl based locks.

http://cmg.dok.org/code/lockview.c

As I copy the file from NT -> Linux 2.4, There are no locks set on the
file. However, if I turn strict locking on, posix.c/is_posix_locked
will return true as soon as I gain the lock and abort the copy.

If just plain locking is on, the file will be deleted as soon as the
copy is complete if another process has gained a write lock.


Does anyone else use samba as a drop box for a unix process?

Is there anyway to make a file be locked upon creation with the copy
command?  I have a hard time figuring out all the paramters for
open_file_shared1

[2004/07/20 13:21:37, 5] smbd/files.c:file_new(123)
  allocated file structure 5634, fnum = 9730 (2 used)
[2004/07/20 13:21:37, 10] smbd/open.c:open_file_shared1(807)
  open_file_shared: fname = output/Testing/cygwin.tar, share_mode = 11, ofun = 10, mode = 660, oplock request
= 3


Thanks,
Chris
-- 
Chris Green <cmg at dok.org>
Eschew obfuscation.



More information about the samba mailing list