windows-vnovol-20080214

LICENSE MIT

avoid a crash when logging VNOVOL errors returned from cm_CheckOfflineVolume
This commit is contained in:
Jeffrey Altman 2008-02-14 19:19:38 +00:00
parent 00bada9c5e
commit 1133cc4418

View File

@ -432,15 +432,17 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
break;
}
/* Log server being offline for this volume */
sprintf(addr, "%d.%d.%d.%d",
((serverp->addr.sin_addr.s_addr & 0xff)),
((serverp->addr.sin_addr.s_addr & 0xff00)>> 8),
((serverp->addr.sin_addr.s_addr & 0xff0000)>> 16),
((serverp->addr.sin_addr.s_addr & 0xff000000)>> 24));
if (serverp && fidp) {
/* Log server being offline for this volume */
sprintf(addr, "%d.%d.%d.%d",
((serverp->addr.sin_addr.s_addr & 0xff)),
((serverp->addr.sin_addr.s_addr & 0xff00)>> 8),
((serverp->addr.sin_addr.s_addr & 0xff0000)>> 16),
((serverp->addr.sin_addr.s_addr & 0xff000000)>> 24));
osi_Log2(afsd_logp, format, osi_LogSaveString(afsd_logp,addr), fidp->volume);
LogEvent(EVENTLOG_WARNING_TYPE, msgID, addr, fidp->volume);
osi_Log2(afsd_logp, format, osi_LogSaveString(afsd_logp,addr), fidp->volume);
LogEvent(EVENTLOG_WARNING_TYPE, msgID, addr, fidp->volume);
}
/* Mark server offline for this volume */
if (!serversp && fidp) {
@ -450,6 +452,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
free_svr_list = 1;
}
}
lock_ObtainWrite(&cm_serverLock);
for (tsrp = serversp; tsrp; tsrp=tsrp->next) {
if (tsrp->server == serverp) {