]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-byte-range-locks-20051006
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 6 Oct 2005 14:48:58 +0000 (14:48 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 6 Oct 2005 14:48:58 +0000 (14:48 +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.

src/WINNT/afsd/cm_vnodeops.c

index 3cce16f87935e60000e3e7d76da12ef93ba61cf5..9cd5ec27e6888165b07e71445394c9eee6d4aa6d 100644 (file)
@@ -18,6 +18,7 @@
 #include <malloc.h>
 #include <string.h>
 #include <stdlib.h>
+#include <errno.h>
 
 #include <osi.h>
 
@@ -4212,7 +4213,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");
                     }