Windows: cm_connLock not required for cm_GetUCell
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 7 Jan 2014 15:53:37 +0000 (10:53 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 9 Jan 2014 19:20:52 +0000 (11:20 -0800)
In cm_ConnByServer() there is no need to hold the cm_connLock across
the cm_GetUCell() call.  Obtain the cm_ucell_t object before the
cm_connLock is obtained.

Change-Id: I971b55e0aae7748b59895785c1c22b5461c4fd35
Reviewed-on: http://gerrit.openafs.org/10680
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsd/cm_conn.c

index 642b766..4f0ce22 100644 (file)
@@ -1655,6 +1655,9 @@ long cm_ConnByServer(cm_server_t *serverp, cm_user_t *userp, afs_uint32 replicat
         userp = cm_rootUserp;
 
     lock_ObtainMutex(&userp->mx);
+    /* find ucell structure */
+    ucellp = cm_GetUCell(userp, serverp->cellp);
+
     lock_ObtainRead(&cm_connLock);
     for (tcp = serverp->connsp; tcp; tcp=tcp->nextp) {
         if (tcp->userp == userp &&
@@ -1663,8 +1666,6 @@ long cm_ConnByServer(cm_server_t *serverp, cm_user_t *userp, afs_uint32 replicat
             break;
     }
 
-    /* find ucell structure */
-    ucellp = cm_GetUCell(userp, serverp->cellp);
     if (!tcp) {
         lock_ConvertRToW(&cm_connLock);
         for (tcp = serverp->connsp; tcp; tcp=tcp->nextp) {