is_locked optimization

Jeremy Allison jra at samba.org
Fri Dec 10 05:25:37 GMT 2004


On Fri, Dec 10, 2004 at 02:50:44PM +1100, tridge at samba.org wrote:
> 
> As an example, a client application might be internally
> multi-threaded, and might use byte range locking on files to prevent
> the threads from colliding. Each of the threads would be operating on
> the same open file handle, so it can be oplocked, but each could be
> operating with a separate smbpid, so their locks should conflict.
> At the very least please write a test that checks that the above
> scenario cannot happen. I will be quite surprised if you find it is
> safe to skip brl locking calls on oplocked files.

I'll add in the test into Samba4, but you are probably right. Having said
that, I still think the optimization is probably useful for Windows
based clients. The Windows redirector almost certainly handles
such things locally, so no such locks will be seen on the wire.

Probably I should add in a switch for this, so that it's an
optimization we can turn on (but probably not by default). The
code change is very simple, so it'll be easy to switch on or off.

Jeremy.


More information about the samba-technical mailing list