mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 13:38:01 +00:00
DEVEL15-windows-volstat-20080206
LICENSE MIT Ensure that the volume status is always updated after a server_ref status change. (cherry picked from commit 04cac1963a4716e57447b28c00629f0ef5a15258)
This commit is contained in:
parent
0222fceb6f
commit
0cd87a3335
@ -393,6 +393,8 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
statep = &volp->ro;
|
||||
else if (fidp->volume == volp->bk.ID)
|
||||
statep = &volp->bk;
|
||||
|
||||
cm_UpdateVolumeStatus(volp, statep->ID);
|
||||
}
|
||||
|
||||
cm_PutVolume(volp);
|
||||
@ -485,11 +487,28 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
||||
/* REDIRECT */
|
||||
if (errorCode == VMOVED) {
|
||||
tsrp->status = srv_deleted;
|
||||
if (fidp) {
|
||||
if (fidp)
|
||||
cm_ForceUpdateVolume(fidp, userp, reqp);
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
tsrp->status = srv_offline;
|
||||
}
|
||||
|
||||
if (fidp) { /* File Server query */
|
||||
code = cm_GetVolumeByID(cellp, fidp->volume, userp, reqp,
|
||||
CM_GETVOL_FLAG_NO_LRU_UPDATE,
|
||||
&volp);
|
||||
if (code == 0) {
|
||||
if (fidp->volume == volp->rw.ID)
|
||||
statep = &volp->rw;
|
||||
else if (fidp->volume == volp->ro.ID)
|
||||
statep = &volp->ro;
|
||||
else if (fidp->volume == volp->bk.ID)
|
||||
statep = &volp->bk;
|
||||
|
||||
cm_UpdateVolumeStatus(volp, statep->ID);
|
||||
}
|
||||
cm_PutVolume(volp);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (free_svr_list) {
|
||||
|
@ -1022,7 +1022,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID)
|
||||
serversp->status = srv_not_busy;
|
||||
}
|
||||
|
||||
lock_ReleaseMutex(&volp->mx);
|
||||
lock_ReleaseMutex(&volp->mx);
|
||||
do {
|
||||
code = cm_ConnFromVolume(volp, volp->rw.ID, cm_rootUserp, &req, &connp);
|
||||
if (code)
|
||||
@ -1036,7 +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);
|
||||
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;
|
||||
@ -1057,7 +1057,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID)
|
||||
serversp->status = srv_not_busy;
|
||||
}
|
||||
|
||||
lock_ReleaseMutex(&volp->mx);
|
||||
lock_ReleaseMutex(&volp->mx);
|
||||
do {
|
||||
code = cm_ConnFromVolume(volp, volp->ro.ID, cm_rootUserp, &req, &connp);
|
||||
if (code)
|
||||
@ -1071,7 +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);
|
||||
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;
|
||||
@ -1092,7 +1092,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID)
|
||||
serversp->status = srv_not_busy;
|
||||
}
|
||||
|
||||
lock_ReleaseMutex(&volp->mx);
|
||||
lock_ReleaseMutex(&volp->mx);
|
||||
do {
|
||||
code = cm_ConnFromVolume(volp, volp->bk.ID, cm_rootUserp, &req, &connp);
|
||||
if (code)
|
||||
@ -1106,7 +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);
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user