Windows: fsLockCount not accurate
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 20 Feb 2012 06:48:20 +0000 (01:48 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 21 Feb 2012 02:08:05 +0000 (18:08 -0800)
Prior to 1.6.2 the file server does not report an accurate value
for the lock state.  In addition, callbacks are not broken when
locks are freed due to lease expiration.

Change-Id: I5b79d1d59c2ace9834cf23dfbef33e343ce6dda0
Reviewed-on: http://gerrit.openafs.org/6741
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsd/cm_vnodeops.c

index c857a5f..91dbcf1 100644 (file)
@@ -4527,13 +4527,19 @@ long cm_IntSetLock(cm_scache_t * scp, cm_user_t * userp, int lockType,
 
     osi_Log2(afsd_logp, "CALL SetLock scp 0x%p for lock %d", scp, lockType);
 
-       if ((lockType != LOCKING_ANDX_SHARED_LOCK && scp->fsLockCount != 0) ||
-               (lockType == LOCKING_ANDX_SHARED_LOCK && scp->fsLockCount < 0))
-       {
-               code = CM_ERROR_LOCK_NOT_GRANTED;
+#if 0
+    /*
+     * The file server prior to 1.6.2 does not report an accurate value
+     * and callbacks are not issued if the lock is dropped due to expiration.
+     */
+    if ((lockType != LOCKING_ANDX_SHARED_LOCK && scp->fsLockCount != 0) ||
+         (lockType == LOCKING_ANDX_SHARED_LOCK && scp->fsLockCount < 0))
+    {
+        code = CM_ERROR_LOCK_NOT_GRANTED;
         osi_Log2(afsd_logp, "CALL SetLock FAILURE, fsLockCount %d code 0x%x", scp->fsLockCount, code);
-               return code;
-       }
+        return code;
+    }
+#endif
 
     memset(&volSync, 0, sizeof(volSync));