kernel support for open share modes

Michael B Allen mba2000 at
Wed Feb 16 03:34:53 GMT 2005

Tim Potter said:
> I am pretty sure that under Linux there is coordination within the
> kernel between NFS locks and SMB oplocks so that there can be no data
> corruption.  Take a look at the various locktest programs in the
> (samba3) torture testsuite.

Yes, with oplocks I know Linux and BSD have ioctrls or whatever specificly
doing SMB oplocks. But between the time Samba opens the file and grabs the
lock the NFS server could swoop in and grab the lock first. Or delete the
file. Combine that the access checks necessary to determine if it should
proceed (e.g. to send an oplock break) and you have quite a few places
where if one operation fails (e.g. because an NFS client swooped in and
did something) you have some serious ping-ponging and backtracking to do.
I can't think of a concrete example off the top of my head but I'm pretty
sure there are scenarios where a race just outright breaks proper
semantics. However again, this level of coordination between Samba and
external programs is pretty rare. I'm just saying technically the only way
to make it truely correct is to wrap the whole open sequence in a shared


More information about the samba-technical mailing list