Hi List, I have a file server which runs samba-3.0.28a. My aim is to share a logical volume ( with XFS filesystem) using SAMBA, NFS and FTP. Since it is a file server I?m very much concerned about file locking. After googling and reading a lot I had set file locking flags in smb.conf ?lock directory = /var/lock/samba strict locking = no locking = yes level2 oplocks = no kernel oplocks = yes oplocks = yes But still I am having lots of problems in file locking. Following conditions are not working as expected CIFS(linux) --> CIFS(windows) NFS --> CIFS CIFS --> FTP How ever CIFS(windows) --> CIFS ( windows) locking working as expected. Can any one suggest best suitable combination file locking parameters for me? Thanks & Regards, Anoop P A
On Tue, May 05, 2009 at 02:42:57AM -0700, Anoop P.A. wrote:> Hi List, > > > > I have a file server which runs samba-3.0.28a. My aim is to share a logical volume ( with XFS filesystem) using SAMBA, NFS and FTP. Since it is a file server I?m very much concerned about file locking. After googling and reading a lot I had set file locking flags in smb.conf > > > > ?lock directory = /var/lock/samba > > strict locking = no > > locking = yes > > level2 oplocks = no > > kernel oplocks = yes > > oplocks = yes > > > > But still I am having lots of problems in file locking. Following conditions are not working as expectedQuestion: What do you expect with which applications? Volker -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.samba.org/archive/samba/attachments/20090505/722bbff1/attachment.bin
Hi Volker, Thanks for the reply. I want basic file locking work as expected. ( i.e. I want to prevent files from getting corrupted while shared across multiple platforms). If some file is opened writing in one client, other clients should not be able to write in to it. My server failing in many scenarios, I could explain one of the scenario as follows. 1. Opened a share using browser in Win XP machine. 2. Mounted same share in a Linux machine through nfs. 3. Initiated a 1 GB file transfer to share in windows 4. Same time tried to copy a file with same name in nfs share.It asked to overwrite existing file( I expect it not to start copy as write lock of that file is being obtained by CIFS client) 5. After a while both the transfers finished. MD5SUM showed resultant file got corrupted. I would like to know best possible file locking options which will prevent files being corrupted while sharing across multiple platform / multiple protocols Thanks Anoop> -----Original Message----- > From: Volker Lendecke [mailto:Volker.Lendecke@SerNet.DE] > Sent: Tuesday, May 05, 2009 4:06 PM > To: Anoop P.A. > Cc: samba@lists.samba.org > Subject: Re: [Samba] file locking options in smb.conf > > On Tue, May 05, 2009 at 02:42:57AM -0700, Anoop P.A. wrote: > > Hi List, > > > > > > > > I have a file server which runs samba-3.0.28a. My aim is to share a > logical volume ( with XFS filesystem) using SAMBA, NFS and FTP. Since it > is a file server I?m very much concerned about file locking. After > googling and reading a lot I had set file locking flags in smb.conf > > > > > > > > ?lock directory = /var/lock/samba > > > > strict locking = no > > > > locking = yes > > > > level2 oplocks = no > > > > kernel oplocks = yes > > > > oplocks = yes > > > > > > > > But still I am having lots of problems in file locking. Following > conditions are not working as expected > > Question: What do you expect with which applications? > > Volker
On Tue, May 05, 2009 at 04:27:30AM -0700, Anoop P.A. wrote:> Hi Volker, > > Thanks for the reply. > I want basic file locking work as expected. ( i.e. I want to prevent files from getting corrupted while shared across multiple platforms). > If some file is opened writing in one client, other clients should not be able to write in to it. > > My server failing in many scenarios, I could explain one of the scenario as follows. > > 1. Opened a share using browser in Win XP machine. > 2. Mounted same share in a Linux machine through nfs. > 3. Initiated a 1 GB file transfer to share in windows > 4. Same time tried to copy a file with same name in nfs share.It asked to overwrite existing file( I expect it not to start copy as write lock of that file is being obtained by CIFS client) > 5. After a while both the transfers finished. MD5SUM showed resultant file got corrupted.No way you will achieve this cross-protocol. Unix just does not know how to lock a complete file like Windows/CIFS does using share modes. Your only chance is to only use Samba and a cifs client file system and ditch NFS and local file access. Volker -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.samba.org/archive/samba/attachments/20090505/be88b0fc/attachment.bin