From 65e966433e0f29ff89cea7f419116ec01f24a8b2 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 14 May 2003 21:16:33 +0000 Subject: Avoid registering for a lock on the server in the event the NFS client has requested the lock in a non-blocking form, instead returning an immediate failure. This appears to help reduce one of my "locks get lost" symptoms involving lockf(1), which attempts a non-blocking lock attempt before actually blocking on the lock. At this point the client still gets back EACCES, which is an issue we're still working. Approved by: re (scottl) Submitted by: Andrew P. Lentvorski, Jr. --- usr.sbin/rpc.lockd/lockd_lock.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'usr.sbin/rpc.lockd') diff --git a/usr.sbin/rpc.lockd/lockd_lock.c b/usr.sbin/rpc.lockd/lockd_lock.c index 3d43f34..9c876f4 100644 --- a/usr.sbin/rpc.lockd/lockd_lock.c +++ b/usr.sbin/rpc.lockd/lockd_lock.c @@ -1401,12 +1401,17 @@ lock_partialfilelock(struct file_lock *fl) if (retval == PFL_NFSDENIED || retval == PFL_HWDENIED) { /* Once last chance to check the lock */ if (fl->blocking == 1) { - /* Queue the lock */ - debuglog("BLOCKING LOCK RECEIVED\n"); - retval = (retval == PFL_NFSDENIED ? - PFL_NFSBLOCKED : PFL_HWBLOCKED); - add_blockingfilelock(fl); - dump_filelock(fl); + if (retval == PFL_NFSDENIED) { + /* Queue the lock */ + debuglog("BLOCKING LOCK RECEIVED\n"); + retval = PFL_NFSBLOCKED; + add_blockingfilelock(fl); + dump_filelock(fl); + } else { + /* retval is okay as PFL_HWDENIED */ + debuglog("BLOCKING LOCK DENIED IN HARDWARE\n"); + dump_filelock(fl); + } } else { /* Leave retval alone, it's already correct */ debuglog("Lock denied. Non-blocking failure\n"); -- cgit v1.1