From: Jeffrey Altman Date: Thu, 5 Jul 2012 18:54:04 +0000 (-0400) Subject: Windows: cm_ConnByServer hold userp->mx only while necessary X-Git-Tag: upstream/1.8.0_pre1^2~2254 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5b9e9265a0df707e9fb79842ab5aa94b59b8e88e;p=packages%2Fo%2Fopenafs.git Windows: cm_ConnByServer hold userp->mx only while necessary The cm_userp_t does not need to be locked while the cm_conn_t force new connection processing is taking place. Change-Id: Ia3711d393d60382b18f7e45621561d2015b97af7 Reviewed-on: http://gerrit.openafs.org/7718 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index c17acd62f..0be99fcc0 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -1594,9 +1594,11 @@ long cm_ConnByServer(cm_server_t *serverp, cm_user_t *userp, afs_uint32 replicat tcp->nextp = serverp->connsp; serverp->connsp = tcp; lock_ReleaseWrite(&cm_connLock); + lock_ReleaseMutex(&userp->mx); } else { lock_ReleaseRead(&cm_connLock); haveconn: + lock_ReleaseMutex(&userp->mx); InterlockedIncrement(&tcp->refCount); lock_ObtainMutex(&tcp->mx); @@ -1608,14 +1610,13 @@ long cm_ConnByServer(cm_server_t *serverp, cm_user_t *userp, afs_uint32 replicat osi_Log0(afsd_logp, "cm_ConnByServer replace connection due to token update"); else osi_Log0(afsd_logp, "cm_ConnByServer replace connection due to crypt change"); - tcp->flags &= ~CM_CONN_FLAG_FORCE_NEW; + tcp->flags &= ~CM_CONN_FLAG_FORCE_NEW; rx_SetConnSecondsUntilNatPing(tcp->rxconnp, 0); rx_DestroyConnection(tcp->rxconnp); cm_NewRXConnection(tcp, ucellp, serverp, replicated); } lock_ReleaseMutex(&tcp->mx); } - lock_ReleaseMutex(&userp->mx); /* return this pointer to our caller */ osi_Log1(afsd_logp, "cm_ConnByServer returning conn 0x%p", tcp);