kernel support for open share modes

David Collier-Brown David.Collier-Brown at Sun.COM
Tue Feb 15 15:14:46 GMT 2005

J. Bruce Fields wrote:
> The application in question is the kernel NFS daemon, which is *not*
> going to do all its filesystem I/O through Samba....

  Unix programs don't use locking a lot: probably the best-known
program that does is c-news. Instead the few that need to protect
against destructive update, like editors, do a simple check
with fstat before writing the fie, to see if it has changed.

  It's windows programs which depend on locks, oplocks and
funny share modes, so the logical question becomes

	What mechanisms do Unix programs need to use to 
	avoid destructive update of Windows files?

  The big, obvious and widely-reported problems arise with 
oplocks, which allow client-side caching, and thereby expose the
Windows files to destructive update if the files are
changed on the server.
  I've not heard reports of other problems, but then I've
not been listening for them (;-))

  Without kernel involvement, a Samba-aware NFS daemon
would need to have a channel to Samba to take at least
oplocks on first encountering a new file undergoing I/O,
and would need to know what to do if the oplock was refused.

 Ditto for share modes, which would require the NFS lock daemon
to get involved, although this is notably easier with NFS v4 !

David Collier-Brown,      | Always do right. This will gratify
Sun Microsystems, Toronto | some people and astonish the rest
davecb at     |                      -- Mark Twain

More information about the samba-technical mailing list