]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fusefs: flock(2) locks must be implemented in-kernel
authorasomers <asomers@FreeBSD.org>
Tue, 28 May 2019 00:03:46 +0000 (00:03 +0000)
committerasomers <asomers@FreeBSD.org>
Tue, 28 May 2019 00:03:46 +0000 (00:03 +0000)
commit5df1cc70442c7b2b575d20f869980a861ecda214
treeae1cce01ec064b0410069467b69f9f927c0a50b8
parente7232f3d4bbe1eb2093278706992b8026d6bcff7
fusefs: flock(2) locks must be implemented in-kernel

If a FUSE file system sets the FUSE_POSIX_LOCKS flag then it can support
fcntl(2)-style locks directly.  However, the protocol does not adequately
support flock(2)-style locks until revision 7.17.  They must be implemented
locally in-kernel instead.  This unfortunately breaks the interoperability
of fcntl(2) and flock(2) locks for file systems that support the former.
C'est la vie.

Prior to this commit flock(2) would get sent to the server as a
fcntl(2)-style lock with the lock owner field set to stack garbage.

Sponsored by: The FreeBSD Foundation
sys/fs/fuse/fuse_vnops.c
tests/sys/fs/fusefs/locks.cc