mirror of
https://git.openafs.org/openafs.git
synced 2025-01-21 08:20:16 +00:00
Windows: use cm_ServerEqual() in cm_Analyze()
In cm_Analyze() when processing VNOVOL, VMOVED or VOFFLINE errors do not use pointer equivalence as the test to determine if a server is affected by the error. Use cm_ServerEqual() instead. Fix cm_ServerEqual() to work even when both cm_server_t objects are not UUID aware. Change-Id: Icb83ba77984075216a44cdeba689bc05e98ed92a Reviewed-on: http://gerrit.openafs.org/3659 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
parent
7c0d4b331e
commit
f25cbdf09f
@ -528,7 +528,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
|||||||
switch ( errorCode ) {
|
switch ( errorCode ) {
|
||||||
case VNOVOL:
|
case VNOVOL:
|
||||||
msgID = MSG_SERVER_REPORTS_VNOVOL;
|
msgID = MSG_SERVER_REPORTS_VNOVOL;
|
||||||
format = "Server %s reported volume %d in cell %s as not attached (does not exist).";
|
format = "Server %s reported volume %d in cell %s as not attached (may have been moved or deleted).";
|
||||||
break;
|
break;
|
||||||
case VMOVED:
|
case VMOVED:
|
||||||
msgID = MSG_SERVER_REPORTS_VMOVED;
|
msgID = MSG_SERVER_REPORTS_VMOVED;
|
||||||
@ -554,7 +554,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
|||||||
|
|
||||||
if (fidp) { /* File Server query */
|
if (fidp) { /* File Server query */
|
||||||
if (serverp) {
|
if (serverp) {
|
||||||
/* Log server being offline for this volume */
|
/* Log server being unavailable for this volume */
|
||||||
sprintf(addr, "%d.%d.%d.%d",
|
sprintf(addr, "%d.%d.%d.%d",
|
||||||
((serverp->addr.sin_addr.s_addr & 0xff)),
|
((serverp->addr.sin_addr.s_addr & 0xff)),
|
||||||
((serverp->addr.sin_addr.s_addr & 0xff00)>> 8),
|
((serverp->addr.sin_addr.s_addr & 0xff00)>> 8),
|
||||||
@ -622,7 +622,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
|
|||||||
((tsrp->server->addr.sin_addr.s_addr & 0xff0000)>> 16),
|
((tsrp->server->addr.sin_addr.s_addr & 0xff0000)>> 16),
|
||||||
((tsrp->server->addr.sin_addr.s_addr & 0xff000000)>> 24));
|
((tsrp->server->addr.sin_addr.s_addr & 0xff000000)>> 24));
|
||||||
|
|
||||||
if (tsrp->server == serverp) {
|
if (cm_ServerEqual(tsrp->server, serverp)) {
|
||||||
/* REDIRECT */
|
/* REDIRECT */
|
||||||
if (errorCode == VMOVED || errorCode == VNOVOL) {
|
if (errorCode == VMOVED || errorCode == VNOVOL) {
|
||||||
osi_Log2(afsd_logp, "volume %d not present on server %s",
|
osi_Log2(afsd_logp, "volume %d not present on server %s",
|
||||||
|
@ -1358,6 +1358,15 @@ int cm_ServerEqual(cm_server_t *srv1, cm_server_t *srv2)
|
|||||||
/* Both support UUID */
|
/* Both support UUID */
|
||||||
if (UuidEqual((UUID *)&srv1->uuid, (UUID *)&srv2->uuid, &status))
|
if (UuidEqual((UUID *)&srv1->uuid, (UUID *)&srv2->uuid, &status))
|
||||||
return 1;
|
return 1;
|
||||||
|
} else {
|
||||||
|
if (srv1->flags & CM_SERVERFLAG_UUID)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/* Neither support UUID so perform an addr/port comparison */
|
||||||
|
if ( srv1->addr.sin_family == srv2->addr.sin_family &&
|
||||||
|
srv1->addr.sin_addr.s_addr == srv2->addr.sin_addr.s_addr &&
|
||||||
|
srv1->addr.sin_port == srv2->addr.sin_port )
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user