why doesn't the kernel enforce oplocks? (was: Re: [Samba] Re: How Samba let us down)

jra at dp.samba.org jra at dp.samba.org
Thu Oct 24 18:59:24 GMT 2002


On Thu, Oct 24, 2002 at 11:48:53AM -0700, Ben Johnson wrote:
> 
> samba and vi aren't written to cooperate for example.  should these be
> written to cooperate?  that would mean the authors of each would have to
> cooperate.  it seems like it would be easier to have the kernel force
> cooperation.

If you're using a text editor that wantes exclusive use of a file, the text
editor should get an fcntl or Windows write lock across the entire contents
of the file before allowing any modification. That's what you actually
intend. Allowing a "share mode" that operates accross an entire open 
is a hack (IMHO).

Samba and vi don't have to co-operate, Samba just allows Windows apps to
see each others byte-range locks. It's the apps on Windows and the UNIX
apps that have to co-operate.

Jeremy.



More information about the samba-technical mailing list