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>
This commit is contained in:
Robert Watson 2003-05-14 21:16:33 +00:00
parent 4d340ec485
commit 86eb7cbada

View File

@ -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");