windows-lock-order-20080916
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 16 Sep 2008 12:26:45 +0000 (12:26 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 16 Sep 2008 12:26:45 +0000 (12:26 +0000)
LICENSE MIT

do not violate lock order when freeing server reference lists

src/WINNT/afsd/cm_volume.c

index d0dd1d6..5a34d0c 100644 (file)
@@ -856,7 +856,9 @@ long cm_FindVolumeByName(struct cm_cell *cellp, char *volumeNamep,
                     cm_VolumeStatusNotification(volp, volp->vol[volType].ID, volp->vol[volType].state, vl_unknown);
                 volp->vol[volType].ID = 0;
                 cm_SetFid(&volp->vol[volType].dotdotFid, 0, 0, 0, 0);
+                lock_ReleaseWrite(&cm_volumeLock);
                 cm_FreeServerList(&volp->vol[volType].serversp, CM_FREESERVERLIST_DELETE);
+                lock_ObtainWrite(&cm_volumeLock);
             }
        } else {
            volp = &cm_data.volumeBaseAddress[cm_data.currentVolumes++];