DEVEL15-windows-down-time-20080205

LICENSE MIT

use clock time instead of osi_Time() for server down time tracking
for proper comparison with expiration times.


(cherry picked from commit ac614c7609f61394da1ea425940a09bf98fbc0ea)
This commit is contained in:
Jeffrey Altman 2008-02-05 17:11:45 +00:00
parent 36f7247bbb
commit b13ed6dec1
5 changed files with 6 additions and 6 deletions

View File

@ -80,7 +80,7 @@ long cm_FindACLCache(cm_scache_t *scp, cm_user_t *userp, afs_uint32 *rightsp)
for (aclp = scp->randomACLp; aclp; aclp = aclp->nextp) {
if (aclp->userp == userp) {
if (aclp->tgtLifetime && aclp->tgtLifetime <= osi_Time()) {
if (aclp->tgtLifetime && aclp->tgtLifetime <= time(NULL)) {
/* ticket expired */
osi_QRemoveHT((osi_queue_t **) &cm_data.aclLRUp, (osi_queue_t **) &cm_data.aclLRUEndp, &aclp->q);
CleanupACLEnt(aclp);

View File

@ -26,7 +26,7 @@ typedef struct cm_aclent {
struct cm_scache *backp; /* back ptr to vnode */
struct cm_user *userp; /* user whose access is cached */
afs_uint32 randomAccess; /* watch for more rights in acl.h */
unsigned long tgtLifetime; /* time this expires */
afs_uint32 tgtLifetime; /* time this expires */
} cm_aclent_t;
extern osi_rwlock_t cm_aclLock;

View File

@ -1062,7 +1062,7 @@ SRXAFSCB_InitCallBackState3(struct rx_call *callp, afsUUID* serverUuid)
char *p = NULL;
if (UuidToString((UUID *)serverUuid, &p) == RPC_S_OK) {
osi_Log1(afsd_logp, "SRXAFSCB_InitCallBackState3 %s ->",p);
osi_Log1(afsd_logp, "SRXAFSCB_InitCallBackState3 %s ->",osi_LogSaveString(afsd_logp,p));
RpcStringFree(&p);
} else
osi_Log0(afsd_logp, "SRXAFSCB_InitCallBackState3 - no server Uuid ->");
@ -1969,7 +1969,7 @@ cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown)
lock_ObtainMutex(&tsp->mx);
if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
tsp->flags |= CM_SERVERFLAG_DOWN;
tsp->downTime = osi_Time();
tsp->downTime = time(NULL);
}
cm_ForceNewConnections(tsp);

View File

@ -563,7 +563,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
if (reqp->flags & CM_REQ_NEW_CONN_FORCED) {
if (!(serverp->flags & CM_SERVERFLAG_DOWN)) {
serverp->flags |= CM_SERVERFLAG_DOWN;
serverp->downTime = osi_Time();
serverp->downTime = time(NULL);
}
} else {
reqp->flags |= CM_REQ_NEW_CONN_FORCED;

View File

@ -154,7 +154,7 @@ cm_PingServer(cm_server_t *tsp)
/* mark server as down */
if (!(tsp->flags & CM_SERVERFLAG_DOWN)) {
tsp->flags |= CM_SERVERFLAG_DOWN;
tsp->downTime = osi_Time();
tsp->downTime = time(NULL);
}
if (code != VRESTARTING)
cm_ForceNewConnections(tsp);