]> git.ipfire.org Git - thirdparty/util-linux.git/commit
flock: make flock(1) work on NFSv4
authorPetr Uzel <petr.uzel@suse.cz>
Thu, 15 Sep 2011 08:19:17 +0000 (10:19 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 18 Oct 2011 12:22:27 +0000 (14:22 +0200)
commit75aaee08f06b92d119ed827c53d1af5474eb16ff
treece181dcf753f75c90b60c35c685b221658376f6c
parent099945d1f7fe1336439d4d380780efb2c8d97d39
flock: make flock(1) work on NFSv4

To pleace an exclusive lock on a file, NFSv4 requires
the file to be opened RW because of the emulation of flock()
by fcntl():

http://www.spinics.net/lists/linux-nfs/msg18502.html

So instead of O_RDONLY, open the file in O_RDWR if access()
indicates it is possible (unless shared lock is requested).

From: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
sys-utils/flock.c