From 36f7247bbb6650a8728152b5e9a54075aa5d17c5 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 5 Feb 2008 17:08:54 +0000 Subject: [PATCH] DEVEL15-windows-check-offline-volumes-20080205 LICENSE MIT Do not hold the cm_volume_t mutex across the RPC (cherry picked from commit db20cd6b718096530e8b2a5f7df7818c4a07783b) --- src/WINNT/afsd/cm_volume.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/WINNT/afsd/cm_volume.c b/src/WINNT/afsd/cm_volume.c index 2e5dd1d550..9d6c01768a 100644 --- a/src/WINNT/afsd/cm_volume.c +++ b/src/WINNT/afsd/cm_volume.c @@ -1022,6 +1022,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID) serversp->status = srv_not_busy; } + lock_ReleaseMutex(&volp->mx); do { code = cm_ConnFromVolume(volp, volp->rw.ID, cm_rootUserp, &req, &connp); if (code) @@ -1035,6 +1036,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID) } while (cm_Analyze(connp, cm_rootUserp, &req, NULL, NULL, NULL, NULL, code)); code = cm_MapRPCError(code, &req); + lock_ObtainMutex(&volp->mx); if (code == 0 && volStat.Online) { cm_VolumeStatusNotification(volp, volp->rw.ID, volp->rw.state, vl_online); volp->rw.state = vl_online; @@ -1055,6 +1057,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID) serversp->status = srv_not_busy; } + lock_ReleaseMutex(&volp->mx); do { code = cm_ConnFromVolume(volp, volp->ro.ID, cm_rootUserp, &req, &connp); if (code) @@ -1068,6 +1071,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID) } while (cm_Analyze(connp, cm_rootUserp, &req, NULL, NULL, NULL, NULL, code)); code = cm_MapRPCError(code, &req); + lock_ObtainMutex(&volp->mx); if (code == 0 && volStat.Online) { cm_VolumeStatusNotification(volp, volp->ro.ID, volp->ro.state, vl_online); volp->ro.state = vl_online; @@ -1088,6 +1092,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID) serversp->status = srv_not_busy; } + lock_ReleaseMutex(&volp->mx); do { code = cm_ConnFromVolume(volp, volp->bk.ID, cm_rootUserp, &req, &connp); if (code) @@ -1101,6 +1106,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID) } while (cm_Analyze(connp, cm_rootUserp, &req, NULL, NULL, NULL, NULL, code)); code = cm_MapRPCError(code, &req); + lock_ObtainMutex(&volp->mx); if (code == 0 && volStat.Online) { cm_VolumeStatusNotification(volp, volp->bk.ID, volp->bk.state, vl_online); volp->bk.state = vl_online;