I have a heterogeneous network with a R.H. Linux server running Samba 3.0.5 and various Win clients (from Win 98 to Win XP Pro). On a Samba share I have an ISAM database (Access, FoxPro etc. like) that is being accessed by applications running on the Win clients and by applications running in Linux. I have disabled "opplocks" in both Win9x clients and on the Samba share. I have "mounted" the Samba share on the Linux server so that Linux applications are "pathed" to the share and accessing the data there. The problem arises with locks. Files locked by the Win clients are seeing as locked by Win clients but not by Linux and viceversa. Any solution for this? I have "played" with options in Samba (level2 oplocks, veto oplocks, locking, kernel oplocks, etc.) without any improvements. One thing that I have clear is oplocks = no. Other parameters we have tried: To be more specific: Network name for Linux machine: pepe Name of Samba share (as seen by Win clients) : testdata Directory where data is on linux machine : /u/testdata Thus data can be accessed by: //pepe/testdata Mount point for Samba share in Linux: / Comand given to mount Samba share: mount -t smbfs -o username=whatever,password=key //pepe/testdata /testdata Checked mounting with: mount gives me : //pepe/testdata mounted on /testdata type smbfs (o) <--- By the way: what means the (o)? Then I make the paths to access the data from Linux to be /testdata and fron win clients to be //pepe/testdata Can you see anything wrong? Tests I am going to make are: 1-Modify the name of the Samba share so that "share name <> name linux directory" 2-Mount the Samba share at another point rather than / 3-Try to access the data from Linux with the same full path as Win clients. In the above case //pepe/testdata rather than /testdata Finally: shouldn't "posix locking = yes" in smb.conf give consistent locking between SMB and posix (NFS or local) access? TIA Jos? Guimar?es [ pg@moose-software.com ] Director Moose Software http://www.moose-software.com <http://www.moose-software.com/>
On Tue, Sep 14, 2004 at 10:23:09AM +0200, Pepe Guimar?es wrote:> I have "mounted" the Samba share on the Linux server so that Linux > applications are "pathed" > to the share and accessing the data there.I'd suspect the problem in smbfs, not samba. What happens if you use the application directly on the samba server without smbfs in between? Volker
On Tue, 2004-09-14 at 18:23, Pepe Guimar?es wrote:> I have a heterogeneous network with a R.H. Linux server running Samba > 3.0.5 and various > Win clients (from Win 98 to Win XP Pro). On a Samba share I have an ISAM > database (Access, FoxPro etc. like) > that is being accessed by applications running on the Win clients and by > applications running in Linux. > I have disabled "opplocks" in both Win9x clients and on the Samba share. > I have "mounted" the Samba share on the Linux server so that Linux > applications are "pathed" > to the share and accessing the data there. > > The problem arises with locks. Files locked by the Win clients are > seeing as locked by Win > clients but not by Linux and viceversa.> Finally: > shouldn't "posix locking = yes" in smb.conf give consistent locking > between SMB and posix (NFS or local) access?Yes and no. 'posix locking = yes' will allow *some* coordination between windows and POSIX locks, but it is far from a complete mapping. I presume your linux-side applications are running under wine? Unfortunately, wine does not yet work with Samba (and Samba does not yet work with wine) to jointly manage the windows locks, which are much richer than can be expressed under posix. Worse still, smbfs does not support locking at all, and NFS is notoriously poor at locking. Andrew Bartlett -- Andrew Bartlett abartlet@samba.org Authentication Developer, Samba Team http://samba.org Student Network Administrator, Hawker College abartlet@hawkerc.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.samba.org/archive/samba/attachments/20040915/309d4a2a/attachment.bin
I think I managed to get a working configuration. I would like to have your opinions. I am running RH 8 with Samba 3.0.5 1) No samba shared mounted on Linux (this way I avoid smbfs) 2) Parameters in smb.conf for the share: -locking = yes -veto oplock files = *.dat/*.k*/*.hdr (in my case) -strict locking = no That last parameter seems to be the one that avoided writing new records to a file by the windows program while that same file was open by the Linux program. Regards
On Wed, 2004-09-15 at 19:49, Pepe Guimar?es wrote:> I think I managed to get a working configuration. > > I would like to have your opinions. > > I am running RH 8 with Samba 3.0.5 > > 1) No samba shared mounted on Linux (this way I avoid smbfs) > > 2) Parameters in smb.conf for the share: > -locking = yes > -veto oplock files = *.dat/*.k*/*.hdr (in my case) > -strict locking = no > > > That last parameter seems to be the one that avoided writing new records > to a file by the windows program while that same file was open by the > Linux program.And as a result, corrupting the database. At a minimum, I would expect you to require that parameter to be on. The rest is up to the windows/posix mappings, and how well the posix side works with the CIFS/POSIX mapping spec. (Developed by HP I think). Andrew Bartlett -- Andrew Bartlett abartlet@samba.org Authentication Developer, Samba Team http://samba.org Student Network Administrator, Hawker College abartlet@hawkerc.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.samba.org/archive/samba/attachments/20040915/b9992e0b/attachment.bin
As I mentioned earlier today we managed to find out a solution to our problems. I am running RH 8 with Samba 3.0.5 1) No samba shared mounted on Linux (this way I avoid smbfs) 2) Parameters in smb.conf for the share: -locking = yes -veto oplock files = *.dat/*.k*/*.hdr (in my case) -strict locking = no That last parameter seems to be the one that avoided writing new records to a file by the windows program while that same file was open by the Linux program. On the other hand, we just finished one last test with 4 programs (2 in linux, 2 in Win) accessing the same file and writing to it simultaneously. Other two programs kept that file open: one in linux and the other in Win. We wrote and read well over 10.000 new records without problems. Locks were respected, file was not damaged, and records were all recorded. So it seems that finally we are on the right track! If we have time we will write another set of programs to go on a loop and keep them alive for a few hours. We will try with 24 sessions open in Linux and as many as possible in Win. We will let you know how it went when we finish. Regards. On Wed, Sep 15, 2004 at 10:52:56AM -0500, Christopher R. Hertel wrote:> Okay, so... > > Based on the info Andrew provided and some of the other comments in > this > thread, it seems that the problem is: > > - Linux/Posix supports locking semantics that are different from those> used by Windows. > > I knew, generally, this was a problem but I wasn't quite sure howmuch> of a problem it was. Seems to be bigger than I thought. The issuehere> is two-fold. First, the Linux client needs to translate locking > semantics to match the needs of CIFS. Next, the Samba server needsto> translate to Posix semantics for all clients. Ouch.Yers, but we do this correctly. So in general there isn't a problem. The issue is usually that the more clients you have writing into a shared file the more critical it is the clients are stable. And mostly Samba is serving Windows clients, so....... :-(. Jeremy.