The Samba-Bugzilla – Bug 5126
EACCES is returned instead of EAGAIN if fcntl(F_SETLK) request fails
Last modified: 2016-02-26 02:11:08 UTC
We use old xBase applications running in dosemu on CIFS filesystem. Applications are multiuser, so locking is used to prevent editing of the same record by several users simultaneously. Problem is that on CIFS file system this seems to not work - several users may start to edit the same record on the same time. There is no such problem if NFS share is used instead. Using strace on dosemu.bin process, we discovered that difference in behavior between NFS and CIFS is that NFS returns EAGAIN when lock request is failed while CIFS returns EACCES.
This may be DOSEMU bug, fcntl() man page describes EACCES as valid error code when lock is failed because of lock held by another process, but returning EAGAIN could have more sense, isn't it ?
Is this still a problem? If so, I could use some more details. You said this
application is multiuser. Are all the users running on the same machine or
different ones? What sort of server are you mounting here?
As you said, EACCES is valid when conflicting locks are held. If you can see another issue (besides EACCES vs. EAGAIN) please reopen with the additional detail.