]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
viced: lockcount only valid if not expired
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 20 Feb 2012 06:40:03 +0000 (01:40 -0500)
committerDerrick Brashear <shadow@dementix.org>
Thu, 23 Feb 2012 01:44:38 +0000 (17:44 -0800)
locks are issued on a lease.  If the lock is expired, the lock
count is zero.

Reviewed-on: http://gerrit.openafs.org/6740
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 4603057d99a1501275f14f6d5aba089364785e09)

Change-Id: I784bdccae6d5fb01c76590ccd34fb9efa417747e
Reviewed-on: http://gerrit.openafs.org/6750
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/viced/afsfileprocs.c

index bc78fc3994a555661a7e275cfcbb3fe090a8a399..260a029ab9b6ecefffa9553850b70b504f7205d5 100644 (file)
@@ -2187,6 +2187,8 @@ static
 GetStatus(Vnode * targetptr, AFSFetchStatus * status, afs_int32 rights,
          afs_int32 anyrights, Vnode * parentptr)
 {
+    int Time =FT_ApproxTime();
+
     /* initialize return status from a vnode  */
     status->InterfaceVersion = 1;
     status->SyncCounter = status->dataVersionHigh = status->lockCount =
@@ -2221,7 +2223,7 @@ GetStatus(Vnode * targetptr, AFSFetchStatus * status, afs_int32 rights,
         Directory ? targetptr->disk.uniquifier : parentptr->disk.uniquifier);
     status->ServerModTime = targetptr->disk.serverModifyTime;
     status->Group = targetptr->disk.group;
-    status->lockCount = targetptr->disk.lock.lockCount;
+    status->lockCount = Time > targetptr->disk.lock.lockTime ? targetptr->disk.lock.lockCount : 0;
     status->errorCode = 0;
 
 }                              /*GetStatus */