Bug 1017478

Summary: manpage for flock(2) says that flock() does not lock files over NFS, when it does
Product: Red Hat Enterprise Linux 6 Reporter: advax
Component: man-pages-overridesAssignee: Jan Chaloupka <jchaloup>
Status: CLOSED ERRATA QA Contact: Iveta Wiedermann <isenfeld>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.4CC: eguan, fs-qe, isenfeld, jchaloup, mtk.manpages, ovasik, steved
Target Milestone: rcKeywords: ManPageChange, Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: man-pages-overrides-6.6.2-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: insufficient information about locking files over NFS Consequence: incomplete documenation Fix: information about locking files over NFS is added Result: updated documentation
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 07:26:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1119562    
Attachments:
Description Flags
The upstream patch
none
flock.2 NFS flock for MPO none

Description advax 2013-10-10 01:52:50 UTC
The manpage for flock(2) states:

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.

But as far as I can tell, from a programmer's point of view, flock() does work over NFS. The shell command "flock a.a bash" experimentlaly locks a file on an NFS mounted volume, while in e.g. linux-2.6.18-274.3.1.el5.x86_64/fs/nfs/file.c
there is a comment
"We're simulating flock() locks using posix locks on the server"

suggesting to me that flock() works on NFS in RHEL5 and RHEL6.

Comment 2 Jan Chaloupka 2014-06-12 12:15:00 UTC
Adding steved.

Hi, Steve,

any progress?

Jan

Comment 3 Michael Kerrisk 2014-06-12 12:57:10 UTC
Upstream e449654fdb3f19aafc569df47d12bffdf6276236 probably addresss this bug, I think. That change will go out with the next release.

Comment 4 Steve Dickson 2014-06-16 15:17:27 UTC
(In reply to Michael Kerrisk from comment #3)
> Upstream e449654fdb3f19aafc569df47d12bffdf6276236 probably addresss this
> bug, I think. That change will go out with the next release.

What git tree is that commit relative to?

Comment 5 Michael Kerrisk 2014-06-16 15:23:36 UTC
man-pages Git
https://www.kernel.org/doc/man-pages/download.html

Comment 6 Steve Dickson 2014-06-16 16:08:57 UTC
Created attachment 909193 [details]
The upstream patch

Comment 8 Jan Chaloupka 2014-06-17 05:58:34 UTC
Created attachment 909385 [details]
flock.2 NFS flock for MPO

Comment 9 Jan Chaloupka 2014-06-17 06:00:31 UTC
Thank you very much guys

Comment 17 errata-xmlrpc 2014-10-14 07:26:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1382.html