summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.lockd
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-05-14 21:16:33 +0000
committerrwatson <rwatson@FreeBSD.org>2003-05-14 21:16:33 +0000
commit65e966433e0f29ff89cea7f419116ec01f24a8b2 (patch)
tree3062a2a224c5c6ef580e0e44f4389872d6ba8975 /usr.sbin/rpc.lockd
parentcf946a90341110a2e768310f41f4295c9a666d8d (diff)
downloadFreeBSD-src-65e966433e0f29ff89cea7f419116ec01f24a8b2.zip
FreeBSD-src-65e966433e0f29ff89cea7f419116ec01f24a8b2.tar.gz
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. <bsder@allcaps.org>
Diffstat (limited to 'usr.sbin/rpc.lockd')
-rw-r--r--usr.sbin/rpc.lockd/lockd_lock.c17
1 files changed, 11 insertions, 6 deletions
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");
OpenPOWER on IntegriCloud