From: Rainer Toebbicke Date: Tue, 20 Jun 2006 15:51:43 +0000 (+0000) Subject: STABLE14-viced-deadlock-20060620 X-Git-Tag: openafs-stable-1_4_2-beta2~33 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=c3eece557f1ea2e989cc15716b0b18c87afcb6d2;p=packages%2Fo%2Fopenafs.git STABLE14-viced-deadlock-20060620 FIXES 34073 * checks for client == oldClient * drops the H_LOCK prior to obtaining the WriteLock on oldClient in order to prevent a deadlock (cherry picked from commit efd74baa950133de6ed92b7395be6d14ef63a58e) --- diff --git a/src/viced/host.c b/src/viced/host.c index d91a8b797..8d87b8dfe 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -1759,7 +1759,7 @@ h_FindClient_r(struct rx_connection *tcon) * the RPC from the other client structure's rock. */ oldClient = (struct client *)rx_GetSpecific(tcon, rxcon_client_key); - if (oldClient && oldClient->sid == rxr_CidOf(tcon) + if (oldClient && oldClient != client && oldClient->sid == rxr_CidOf(tcon) && oldClient->VenusEpoch == rxr_GetEpoch(tcon)) { char hoststr[16]; if (!oldClient->deleted) { @@ -1782,8 +1782,10 @@ h_FindClient_r(struct rx_connection *tcon) FreeCE(client); created = 0; } - ObtainWriteLock(&oldClient->lock); oldClient->refCount++; + H_UNLOCK; + ObtainWriteLock(&oldClient->lock); + H_LOCK; client = oldClient; } else { ViceLog(0, ("FindClient: deleted client %x(%x) already had conn %x (host %s:%d), stolen by client %x(%x)\n",