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:30:05 GMT 2002

On Thu, Oct 24, 2002 at 11:24:38AM -0700, Ben Johnson wrote:
> Thanks for the explanation.
> I never understood why *nix doesn't implement some kind of file locking
> mechanism that actually enforces file locks.  I can see why the
> traditional "advisory" locking semantics are useful, but wouldn't a
> locking system that is actually enforced by the kernel potentially be
> much more useful?  Does anyone know why this hasn't been done?  Why
> wasn't this done when oplock support was added?  is it out of desire to
> maintain a standard?  I'm thinking about trying to implement it.

POSIX has "mandatory" locks that are kernel enforced. Almost no application
uses them and they also require permission changes on the file.

There is nothing that share modes do that cannot be done with fcntl locks
and co-operating applications. Share modes (IMHO) are just a bad design,
added to Windows because they were in DOS, added to DOS because it wasn't
designed, just 'hacked up' from an old CP/M clone.

If your applications aren't written to cooperate, what are they doing
accessing the data in the same file ? It's just a disaster waiting to


More information about the samba-technical mailing list