]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-windows-byte-range-locks-20051006
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 6 Oct 2005 14:50:11 +0000 (14:50 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 6 Oct 2005 14:50:11 +0000 (14:50 +0000)
Do not mark locks lost simply because the ExtendLock failed.
A lock is only lost if the server responds with EINVAL indicating
that the lock no longer exists. A lock can be renewed by other clients
that are also using the file.  The client can make no assumptions about
the status of a lock based upon the passage of time.

(cherry picked from commit 8445720d36474797b67341991f15771dcb90b236)

src/WINNT/afsd/cm_vnodeops.c

index 868bd3600979e0267cc3268249a5ac2c4980b4f9..c752c1870c404fca1cce1e5fc42cd2af08ba052e 100644 (file)
@@ -18,6 +18,7 @@
 #include <malloc.h>
 #include <string.h>
 #include <stdlib.h>
+#include <errno.h>
 
 #include <osi.h>
 
@@ -4195,7 +4196,8 @@ void cm_CheckLocks()
 
                     if (code) {
                         osi_Log1(afsd_logp, "CALL ExtendLock FAILURE, code 0x%x", code);
-                        cm_LockMarkSCacheLost(scp);
+                       if (code == EINVAL || code == CM_ERROR_INVAL)
+                           cm_LockMarkSCacheLost(scp);
                     } else {
                         osi_Log0(afsd_logp, "CALL ExtendLock SUCCESS");
                     }