I read
http://www.faqs.org/docs/samba/ch08.html
I test and play with all the lock variants
locking
strict locking
oplocks
veto oplock files
My configuration now:
oplocks = yes
level2 oplocks = Yes
strict locking = yes
And the situation is following:
I have x86_64 FC5 server Samba and NFS on it + XP user + Lin user.
1.Xp user opens water.xls via Samba
2.Samba locks the file.
3.Lin user opens the file water.xls after 20 seconds via NFS.
4.As Samba has locked the file, Lin users see (water.xls READ ONLY)
SO far seems everything is working really FINE.
Problems start when we go further on.
5.Lin users after 5 minutes tries to open water.xls to edit it, in the same time XP user is still working with it.
6.Lin user opens water.xls and it is WRITABLE. , however XP user still edits it.
7.The result is corrupted file, not saved file, information lost for XP user, time lost for XP user.
What happened?
Problem:
Samba locks the file fine, however after one Lin user try to open the file lock is broken by Lin user. So next time Lin users opens the file – file is not locked, because samba lock ir broken.
But Samba lock is made:
by XP user opening file or b
y XP user saving file.
So for example, to ensure that file is locked Xp user needs to save file each time (it locks file again, if it was unlocked), when Lin user opens the file (unlocks it).
It is is possible to open file on Lin first time Read Only, then close it. And after a three seconds open it and now it is writable. So Lin user can hack the file just with two times opening the locked file. Not good, right? In real life it means: that file is editing Xp user, then comes Lin user first time, after a time Lin users hopes, that file is not edited any more and he opens the file, however in 30% the file is still editing by XP user. The Lin users does changes and save all, but XP user looses his job.
Thanks for help to everyone!
Are there any ideas how to solve this?
Maris