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

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Feb 7 19:52:39 UTC 2019

On Thu, Feb 07, 2019 at 10:34:20AM -0500, J. Bruce Fields wrote:
> Honestly I'd been hoping we could just deprecate mandatory locking
> completely!  But if this is a priority then we should figure out how to
> save it.

Possibly we can postpone that a bit. We lived with that forever, but
for completeness we'll need it at some point.

> We should look at Pavel Shilovsky's patches.  He did define
> 	https://lwn.net/Articles/557079/

Looks interesting. We need to be able to query DENYDELETE at least on
an open fd, or even rather at open time.

> An NFS client can keep the delegation after it closes the file, I think
> of it as independent of any one open.

What is a delegation then? How is this referenced in the protocol?

> Sounds vaguely like NFS delegations.  But I don't know what a lease key
> is, or what bumping an fd means.

By "bumping up" I mean that a client opens the same file multiple
times. fd 1 references a lease key without any caching permission. The
same client opens the same file a second time referencing the same
lease key, this time it gets a RW lease. As this is the same file and
lease key, also on fd1 RW caching is allowed now. The caching
permission exists independent of a particular file handle, but when
all handles are closed, the lease key also vanishes. SMB1 oplocks were
strictly attached to a particular open instance. If it was broken for
one handle, it never came back.


SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: 0551-370000-0, mailto:kontakt at sernet.de
Gesch.F.: Dr. Johannes Loxen und Reinhild Jung
AG Göttingen: HR-B 2816 - http://www.sernet.de

More information about the samba-technical mailing list