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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2012-07-05 14:54:04 -04:00
parent c3ce54e6b7
commit 5b9e9265a0

View File

@ -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);