[Samba] file locking options in smb.conf

Anoop P.A. Anoop_P.A at pmc-sierra.com
Wed May 6 06:35:54 GMT 2009

Hi list,

Any body implemented cross protocol file locking before? Any pointer
will help me a lot

Hi Volker,

CIFS -> CIFS locking is not working as expected. It failed for me in
following scenario.

1. Opened a share using browser in Win XP machine.
2. Copied a word document (*.doc) to share.
3. Mounted CIFS share in a Ubuntu (8.04 LTS desktop). 
4. Opened word document from Ubuntu using openoffice 2.4
5. Tried to open same file in Win XP but it didn't open and got error
message "No proper file permission" (I expect word document to open   in
read only mode).

However if I open document first in Win XP and then using Open office
working as expected i.e. Document getting opened in read only mode.

> -----Original Message-----
> From: Volker Lendecke [mailto:Volker.Lendecke at SerNet.DE]
> Sent: Tuesday, May 05, 2009 5:19 PM
> To: Anoop P.A.
> Cc: samba at lists.samba.org
> Subject: Re: [Samba] file locking options in smb.conf
> 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
> be able to write in to it.
> >
> > My server failing in many scenarios, I could explain one of the
> 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
> 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
> 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

More information about the samba mailing list