[PATCH] flock() files even with a permissive share mode.

J. Bruce Fields bfields at fieldses.org
Wed Feb 6 22:38:11 UTC 2019


On Wed, Feb 06, 2019 at 02:01:31PM -0800, Jeremy Allison wrote:
> On Wed, Feb 06, 2019 at 04:15:06PM -0500, J. Bruce Fields via samba-technical wrote:
> > On Wed, Feb 06, 2019 at 09:26:09PM +0100, Volker Lendecke wrote:
> > > On Wed, Feb 06, 2019 at 03:13:28PM -0500, J. Bruce Fields via samba-technical wrote:
> > > > I could help write up or compile some sort of "introduction to NFS
> > > > locking for SMB developers".  NFSv4 has byte-range locks, share locks,
> > > > and delegations, you're interested in all three?
> > > 
> > > Very much so. For a start:
> > > 
> > > brlocks == brlocks (how similar are they to Posix in NFS?)
> > 
> > Right.  They're the same as posix locks, so the documentation under
> > "Advisory record locking" in the fcntl(2) man page should all apply.
> > They're fully implemented and commonly used on both the client and
> > server side.
> 
> Quick comment. SMB2+ (and Samba) implements F_OFD locks
> these days which have slightly different semantics to
> standard POSIX locks (i.e. locks on a different file
> descriptor from the same process can conflict). Does
> NFSv4+ make any allowances for OFD locks these days ?

The Linux client supports OFD locks.  No changes are required to NFS
servers or to the NFS protocol.  The server doesn't know which kind of
locks (traditional POSIX or OFD) you're using, the differences are all
in "who" the client chooses to tell you owns each lock.

--b.



More information about the samba-technical mailing list