Skip to contentSkip to conversation

flock(2) does work with NFS/NLM

PATCH New Sebastian Krohn 1 participant 1 message Mar 17, 2010 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 flock(2) does work with NFS/NLM

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

Quoted 3 lines

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:

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

Thus, I believe this paragraph should be deleted.

Regards,

Sebastian

man2/flock.2 +0 -7
index f009ea3..d604318 100644
@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html