windows-callback-lock-order-20080827
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 27 Aug 2008 23:01:51 +0000 (23:01 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 27 Aug 2008 23:01:51 +0000 (23:01 +0000)
LICENSE MIT

do not hold cm_server_t mutex when calling cm_FindVolumeByID because
the cm_volume_t lock must be obtained ahead of the cm_server_t mutex

src/WINNT/afsd/cm_callback.c

index 3d0941b..899c9b1 100644 (file)
@@ -1963,13 +1963,14 @@ cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown)
                         cm_req_t req;
 
                         cm_InitReq(&req);
-
+                        lock_ReleaseMutex(&tsp->mx);
                         code = cm_FindVolumeByID(tsp->cellp, tsrvp->ids[i], cm_rootUserp,
                                                  &req, CM_GETVOL_FLAG_NO_LRU_UPDATE | CM_GETVOL_FLAG_NO_RESET, &volp);
+                        lock_ObtainMutex(&tsp->mx);
                         if (code == 0) {    
                             cm_UpdateVolumeStatus(volp, tsrvp->ids[i]);
                             cm_PutVolume(volp);
-                        }
+                        }       
                     }
                 }
             }