[linux-cifs-client] Re: fcntl(): file unlocking failure

Loris Boillet lb at 2m.dk
Wed Nov 15 09:30:45 GMT 2006


On Tue, 2006-11-14 at 08:56 -0600, Steve French wrote:
> > I need to open a file and to lock it for both read and write access.
> >
> > The file is in a network directory on a Windows server. To access it
> > from Linux (Debian), I use CIFS with mandatory locks activated:
> >
> > mount -t cifs -o mand \\\\server\\share MountFolder
> >
> > I test it with a C program using fcntl(). It behaves well if I mount the
> > share with SMBFS. But with CIFS, unlocking operation fails: I get Error
> > 5: Input / Output Error.
> >
> > Test program:
...
> > Why does unlock fail?
> >
> > Thanks
> >
> >
> >   
> Which kernel?  You can type "cat /proc/version" to check the version.
> 
> There was a bug introduced in 2.6.18 (fixed in 2.6.19) for posix byte 
> range unlock to Windows servers.
> 
> To work around it you can mount with the mount option "nobrl" (which 
> makes cifs like smbfs not
> send byte range lock requests to the server, and just check them 
> locally).   This may get updated
> in a 2.6.18 point release but is fixed in 2.6.19
> 

Kernel is based on a 2.4.33.3 with latest CIFS patch applied
(cifs-1.20c-2.4). It seems that the "nobrl" mount option appeared later,
no? I can't see it in the man pages, neither grep.

I also tested it with a 2.6.8-2-386 kernel: same result. But my need is
to get it working on a 2.4 kernel.

Thanks

Loris




More information about the linux-cifs-client mailing list