flock.2: Move NFS details to a headed subsection

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-10-03 15:23:08 +02:00
parent 2050975ecc
commit 50bfd0b3e2
1 changed files with 31 additions and 31 deletions

View File

@ -169,37 +169,6 @@ locks
.I do
interact with one another.)
.PP
In Linux kernels up to 2.6.11,
.BR flock ()
does not lock files over NFS
(i.e., the scope of locks was limited to the local system).
Instead, one could use
.BR fcntl (2)
byte-range locking, which does work over NFS,
given a sufficiently recent version of
Linux and a server which supports locking.
Since Linux 2.6.12, NFS clients support
.BR flock ()
locks by emulating them as byte-range locks on the entire file.
This means that
.BR fcntl (2)
and
.BR flock ()
locks
.I do
interact with one another over NFS.
Since Linux 2.6.37,
.\" commit 5eebde23223aeb0ad2d9e3be6590ff8bbfab0fc2
the kernel supports a compatibility mode that allows
.BR flock ()
locks (and also
.BR fcntl (2)
byte region locks) to be treated as local;
see the discussion of the
.I "local_lock"
option in
.BR nfs (5).
.PP
.BR flock ()
places advisory locks only; given suitable permissions on a file,
a process is free to ignore the use of
@ -231,6 +200,37 @@ was specified.
and occurs on many other implementations.)
.\" Kernel 2.5.21 changed things a little: during lock conversion
.\" it is now the highest priority process that will get the lock -- mtk
.SS NFS details
In Linux kernels up to 2.6.11,
.BR flock ()
does not lock files over NFS
(i.e., the scope of locks was limited to the local system).
Instead, one could use
.BR fcntl (2)
byte-range locking, which does work over NFS,
given a sufficiently recent version of
Linux and a server which supports locking.
Since Linux 2.6.12, NFS clients support
.BR flock ()
locks by emulating them as byte-range locks on the entire file.
This means that
.BR fcntl (2)
and
.BR flock ()
locks
.I do
interact with one another over NFS.
Since Linux 2.6.37,
.\" commit 5eebde23223aeb0ad2d9e3be6590ff8bbfab0fc2
the kernel supports a compatibility mode that allows
.BR flock ()
locks (and also
.BR fcntl (2)
byte region locks) to be treated as local;
see the discussion of the
.I "local_lock"
option in
.BR nfs (5).
.SH SEE ALSO
.BR flock (1),
.BR close (2),