[PATCH] flock(2) does work with NFS/NLM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While debugging an NFS setup I've noticed flock(2) says the following:

> flock() does not lock files over NFS. Use fcntl(2) instead: that does
> work over NFS, given a sufficiently recent version of Linux and a
> server which supports locking.

This is not true. I used flock(1) which uses flock(2) as per it's
manpage and strace and the locks worked fine:

> NLM[host,0]: 0:0 1 GRANTED (0x0000000062720038) \
>    fsid=0x00c8c721 fileid=0x004108d1

Thus, I believe this paragraph should be deleted.

Regards,

   Sebastian


diff --git a/man2/flock.2 b/man2/flock.2
index f009ea3..d604318 100644
--- a/man2/flock.2
+++ b/man2/flock.2
@@ -143,13 +143,6 @@ possibly implemented in terms of
 .BR fcntl (2),
 appears on most Unix systems.
 .SH NOTES
-.BR flock ()
-does not lock files over NFS.
-Use
-.BR fcntl (2)
-instead: that does work over NFS, given a sufficiently recent version of
-Linux and a server which supports locking.
-.PP
 Since kernel 2.0,
 .BR flock ()
 is implemented as a system call in its own right rather
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux