mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
Windows: multi ping do not leak ping count
In cm_CheckServersMulti() if cm_ConnByServer() fails or if cm_noIPAddr is zero then a cm_server.pingCount will be leaked. This can result in servers being marked down and never restored to an up state. This change adds the necessary pingCount decrement and moves the assignment of the cm_server_t pointer to serversp[] to make it clear that the cm_server_t will not be in the array if a failure occurs. Only objects in the array will have the pingCount decremented after the RPCs are issued. Change-Id: I18895c848039e4131a674d814019f236a1b0e5b5 Reviewed-on: http://gerrit.openafs.org/12048 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
parent
f8bf8221db
commit
3957abea2a
@ -527,17 +527,17 @@ static void cm_CheckServersMulti(afs_uint32 flags, cm_cell_t *cellp)
|
||||
InterlockedIncrement(&tsp->pingCount);
|
||||
lock_ReleaseMutex(&tsp->mx);
|
||||
|
||||
serversp[nconns] = tsp;
|
||||
if (cm_noIPAddr > 0)
|
||||
code = cm_ConnByServer(tsp, cm_rootUserp, FALSE, &conns[nconns]);
|
||||
else
|
||||
code = RX_CALL_DEAD;
|
||||
if (code) {
|
||||
if (code == RX_CALL_DEAD) {
|
||||
lock_ObtainMutex(&tsp->mx);
|
||||
lock_ObtainMutex(&tsp->mx);
|
||||
if (code == RX_CALL_DEAD)
|
||||
cm_MarkServerDown(tsp, code, isDown);
|
||||
lock_ReleaseMutex(&tsp->mx);
|
||||
}
|
||||
InterlockedDecrement(&tsp->pingCount);
|
||||
lock_ReleaseMutex(&tsp->mx);
|
||||
|
||||
lock_ObtainRead(&cm_serverLock);
|
||||
cm_PutServerNoLock(tsp);
|
||||
continue;
|
||||
@ -546,7 +546,7 @@ static void cm_CheckServersMulti(afs_uint32 flags, cm_cell_t *cellp)
|
||||
rxconns[nconns] = cm_GetRxConn(conns[nconns]);
|
||||
if (conntimer[nconns] = (isDown ? 1 : 0))
|
||||
rx_SetConnHardDeadTime(rxconns[nconns], 10);
|
||||
|
||||
serversp[nconns] = tsp;
|
||||
nconns++;
|
||||
}
|
||||
lock_ReleaseRead(&cm_serverLock);
|
||||
@ -669,17 +669,17 @@ static void cm_CheckServersMulti(afs_uint32 flags, cm_cell_t *cellp)
|
||||
InterlockedIncrement(&tsp->pingCount);
|
||||
lock_ReleaseMutex(&tsp->mx);
|
||||
|
||||
serversp[nconns] = tsp;
|
||||
if (cm_noIPAddr > 0)
|
||||
code = cm_ConnByServer(tsp, cm_rootUserp, FALSE, &conns[nconns]);
|
||||
else
|
||||
code = RX_CALL_DEAD;
|
||||
if (code) {
|
||||
if (code == RX_CALL_DEAD) {
|
||||
lock_ObtainMutex(&tsp->mx);
|
||||
lock_ObtainMutex(&tsp->mx);
|
||||
if (code == RX_CALL_DEAD)
|
||||
cm_MarkServerDown(tsp, code, isDown);
|
||||
lock_ReleaseMutex(&tsp->mx);
|
||||
}
|
||||
InterlockedDecrement(&tsp->pingCount);
|
||||
lock_ReleaseMutex(&tsp->mx);
|
||||
|
||||
lock_ObtainRead(&cm_serverLock);
|
||||
cm_PutServerNoLock(tsp);
|
||||
continue;
|
||||
@ -689,7 +689,7 @@ static void cm_CheckServersMulti(afs_uint32 flags, cm_cell_t *cellp)
|
||||
conntimer[nconns] = (isDown ? 1 : 0);
|
||||
if (isDown)
|
||||
rx_SetConnHardDeadTime(rxconns[nconns], 10);
|
||||
|
||||
serversp[nconns] = tsp;
|
||||
nconns++;
|
||||
}
|
||||
lock_ReleaseRead(&cm_serverLock);
|
||||
|
Loading…
Reference in New Issue
Block a user