Commit 75aaee08 authored by Petr Uzel's avatar Petr Uzel Committed by Karel Zak
Browse files

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: default avatarPetr Uzel <petr.uzel@suse.cz>
parent 099945d1
Branches
Tags
No related merge requests found
Showing with 5 additions and 2 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment