flock.2: add CIFS details
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
@@ -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
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
@@ -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
PATCH 3/3 setbuf.3: tfix
In reply to Alejandro Colomar--- man3/setbuf.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man3/setbuf.3 +1 -1
@@ -229,7 +229,7 @@ int main(void) { char buf[BUFSIZ]; - setbuf(stdin, buf); + setbuf(stdout, buf); printf("Hello, world!\en"); return 0; }
Signature · 1 line
2.31.0