summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.lockd
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-05-15 03:19:30 +0000
committerrwatson <rwatson@FreeBSD.org>2003-05-15 03:19:30 +0000
commitac48fcc177e0c1e9f20f76f4a6a9ec833537a1e3 (patch)
treeaacf3f47e8175948e676ce6d04c02ab0630ce509 /usr.sbin/rpc.lockd
parente01c3427e31ddc022acd55593e818815c036618c (diff)
downloadFreeBSD-src-ac48fcc177e0c1e9f20f76f4a6a9ec833537a1e3.zip
FreeBSD-src-ac48fcc177e0c1e9f20f76f4a6a9ec833537a1e3.tar.gz
When getting back an NLM DENIED response for a requested lock from the
server, map it to EAGAIN locally rather than EACCES. The NLM spec indicates the DENIED corresponds to lock contention, not a permission failure. This fixes O_EXLOCK/O_SHLOCK with O_NONBLOCK, which would previously give a permission error, which in turn fixes things like mailq(8) and lockf(1) over NFS. Approved by: scottl (re) Reviewed by: truckman, Andrew P Lentvorski, Jr. <bsder@allcaps.org> Idea from: truckman
Diffstat (limited to 'usr.sbin/rpc.lockd')
-rw-r--r--usr.sbin/rpc.lockd/kern.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/rpc.lockd/kern.c b/usr.sbin/rpc.lockd/kern.c
index 2576258..4bd2f72 100644
--- a/usr.sbin/rpc.lockd/kern.c
+++ b/usr.sbin/rpc.lockd/kern.c
@@ -487,7 +487,7 @@ lock_answer(int pid, netobj *netcookie, int result, int *pid_p, int version)
break;
case nlm4_denied:
if (pid_p == NULL)
- ans.la_errno = EACCES;
+ ans.la_errno = EAGAIN;
else {
/* this is an answer to a nlm_test msg */
ans.la_set_getlk_pid = 1;
@@ -530,7 +530,7 @@ lock_answer(int pid, netobj *netcookie, int result, int *pid_p, int version)
break;
case nlm_denied:
if (pid_p == NULL)
- ans.la_errno = EACCES;
+ ans.la_errno = EAGAIN;
else {
/* this is an answer to a nlm_test msg */
ans.la_set_getlk_pid = 1;
OpenPOWER on IntegriCloud