Skip to contentSkip to conversation

flock.2: add CIFS details

PATCH New Alejandro Colomar 1 participant 3 messages Apr 16, 2021 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 flock.2: add CIFS details

From: Aurelien Aptel <[email protected]>

CIFS flock() locks behave differently than the standard. Give overview of those differences.

Here is the rendered text:

CIFS details
In Linux kernels up to 5.4, flock() is not propagated over SMB. A file with such locks will not appear locked for remote clients.

Since Linux 5.5, flock() locks are emulated with SMB byte-range locks
on the entire file. Similarly to NFS, this means that fcntl(2) and
flock() locks interact with one another. Another important side-effect is that the locks are not advisory anymore: any IO on a locked file will always fail with EACCES when done from a separate file descriptor. This difference originates from the design of locks in the SMB proto- col, which provides mandatory locking semantics.

Remote and mandatory locking semantics may vary with SMB protocol, mount options and server type. See mount.cifs(8) for additional infor- mation.

Discussion: linux-man <https://lore.kernel.org/linux-man/[email protected]/>

---
 man2/flock.2 | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
man2/flock.2 +25 -0
index 328377365..61822c9bc 100644
@@ -239,6 +239,31 @@ see the discussion of the
 .I "local_lock"
 option in
 .BR nfs (5).
+.SS CIFS details
+In Linux kernels up to 5.4,
+.BR flock ()
+is not propagated over SMB.
+A file with such locks will not appear locked for remote clients.
+.PP
+Since Linux 5.5,
+.BR flock ()
+locks are emulated with SMB byte-range locks on the entire file.
+Similarly to NFS, this means that
+.BR fcntl (2)
+and
+.BR flock ()
+locks interact with one another.
+Another important side-effect is that the locks are not advisory anymore:
+any IO on a locked file will always fail with
+.BR EACCES
+when done from a separate file descriptor.
+This difference originates from the design of locks in the SMB protocol,
+which provides mandatory locking semantics.
+.PP
+Remote and mandatory locking semantics may vary with SMB protocol, mount options and server type.
+See
+.BR mount.cifs (8)
+for additional information.
 .SH SEE ALSO
 .BR flock (1),
 .BR close (2),
Signature · 1 line
2.31.0
#1 lore raw

PATCH 2/3 sigaltstack.2: tfix

From: Borislav Petkov <[email protected]>

Add a missing "to" in an "in order to" formulation.

---
 man2/sigaltstack.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man2/sigaltstack.2 +1 -1
index c8d5c184f..53268ccbe 100644
@@ -111,7 +111,7 @@ Clear the alternate signal stack settings on entry to the signal handler.
 When the signal handler returns,
 the previous alternate signal stack settings are restored.
 .IP
-This flag was added in order make it safe
+This flag was added in order to make it safe
 to switch away from the signal handler with
 .BR swapcontext (3).
 Without this flag, a subsequently handled signal will corrupt
Signature · 1 line
2.31.0