]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-deadlock-20070619
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 19 Jun 2007 13:04:04 +0000 (13:04 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 19 Jun 2007 13:04:04 +0000 (13:04 +0000)
fix deadlock on cm_volumeLock introduced by last week's work

in cm_Analyze, make sure we get a cm_cell_t reference otherwise we
won't find the cm_volume_t we are searching for when ALLOFFLINE or
ALLBUSY.

(cherry picked from commit 59db9812209d5e54cc47fc32d626b8b73f7fc22b)

src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_volume.c

index 37b93d690c30df78218ce647233f0d3b2f7e517f..1b675b116ecfb7d5342eb51b3ac53a4b04f2c71c 100644 (file)
@@ -222,6 +222,9 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
                 if ( refp->server )
                     cellp = refp->server->cellp;
             }
+        } 
+        if (cellp == NULL && fidp) {
+            cellp = cm_FindCellByID(fidp->cell);
         }
     }
 
index 9e377d8594ea59a202eb84e8d55c5736148d50ef..1c4c651fcd1f21121c80c1184b8ea6662f6daa11 100644 (file)
@@ -762,16 +762,16 @@ long cm_GetVolumeByName(struct cm_cell *cellp, char *volumeNamep,
         cm_AddVolumeToNameHashTable(volp);
         lock_ReleaseWrite(&cm_volumeLock);
     }
-    else if (volp) {
+    else {
         lock_ReleaseRead(&cm_volumeLock);
-        cm_GetVolume(volp);
-        lock_ObtainMutex(&volp->mx);
+        if (volp) {
+            cm_GetVolume(volp);
+            lock_ObtainMutex(&volp->mx);
+        } else {
+            return CM_ERROR_NOSUCHVOLUME;
+        }
     }
 
-    /* if we don't have a volp structure return no such volume */
-    if (!volp)
-        return CM_ERROR_NOSUCHVOLUME;
-
     /* if we get here we are holding the mutex */
     if (volp->flags & CM_VOLUMEFLAG_RESET) {
        code = cm_UpdateVolume(cellp, userp, reqp, volp);