linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [man-pages][PATCH v1] flock.2: add CIFS details
@ 2021-03-02 15:48 Aurélien Aptel
  2021-03-03 15:37 ` Tom Talpey
  0 siblings, 1 reply; 29+ messages in thread
From: Aurélien Aptel @ 2021-03-02 15:48 UTC (permalink / raw)
  To: linux-cifs, linux-fsdevel, linux-man, mtk.manpages
  Cc: smfrench, Aurelien Aptel

From: Aurelien Aptel <aaptel@suse.com>

Similarly to NFS, CIFS flock() locks behave differently than the
standard. Document those differences.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
---
 man2/flock.2 | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/man2/flock.2 b/man2/flock.2
index 61d4b5396..9271b8fef 100644
--- a/man2/flock.2
+++ b/man2/flock.2
@@ -239,6 +239,28 @@ see the discussion of the
 .I "local_lock"
 option in
 .BR nfs (5).
+.SS CIFS details
+CIFS mounts share similar limitations with NFS.
+.PP
+In Linux kernels up to 5.4,
+.BR flock ()
+locks files on the local system,
+not over SMB. A locked file won't appear locked for other SMB clients
+accessing the same share.
+.PP
+Since Linux 5.5,
+.BR flock ()
+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 over SMB. Another important
+side-effect is that the locks are not advisory anymore: a write on a
+locked file will always fail with
+.BR EACCESS .
+This difference originates from the design of locks in the SMB
+protocol and cannot be worked around.
 .SH SEE ALSO
 .BR flock (1),
 .BR close (2),
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2021-04-11 19:12 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 15:48 [man-pages][PATCH v1] flock.2: add CIFS details Aurélien Aptel
2021-03-03 15:37 ` Tom Talpey
2021-03-03 16:28   ` Aurélien Aptel
2021-03-03 16:37     ` [PATCH v2] " Aurélien Aptel
2021-03-03 18:08       ` Tom Talpey
2021-03-03 19:03         ` [PATCH v3] " Aurélien Aptel
2021-03-03 20:23           ` Tom Talpey
2021-03-04  9:48             ` Aurélien Aptel
2021-03-04  9:50               ` [PATCH v4] " Aurélien Aptel
2021-03-10 19:07                 ` Alejandro Colomar (man-pages)
2021-03-11 10:11                   ` Aurélien Aptel
2021-03-11 16:21                     ` Tom Talpey
2021-03-11 17:13                       ` Aurélien Aptel
2021-03-11 17:29                         ` Tom Talpey
2021-03-11 17:45                           ` Aurélien Aptel
2021-03-11 20:42                             ` Tom Talpey
2021-03-11 22:39                               ` Aurélien Aptel
2021-03-15 18:05                                 ` Pavel Shilovsky
2021-03-16 10:42                                   ` Aurélien Aptel
2021-03-16 17:39                                     ` Pavel Shilovsky
2021-03-16 19:42                                       ` Tom Talpey
2021-03-16 23:04                                         ` Pavel Shilovsky
2021-03-22 14:30                                           ` [PATCH v5] " Aurélien Aptel
2021-04-09 12:13                                             ` Aurélien Aptel
2021-04-11 19:12                                               ` Alejandro Colomar (man-pages)
2021-03-11 18:01                 ` [PATCH v4] " Matthew Wilcox
2021-03-03 16:48     ` [man-pages][PATCH v1] " Tom Talpey
2021-03-03 16:57       ` Aurélien Aptel
2021-03-03 17:41         ` Tom Talpey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).