ubik: Log sync site for SDISK_SendFile USYNC error
[openafs.git] / src / ubik / remote.c
index 1c5a6af..2fca3b1 100644 (file)
@@ -463,8 +463,7 @@ SDISK_SendFile(struct rx_call *rxcall, afs_int32 file,
     pbuffer[0] = '\0';
 
     if ((code = ubik_CheckAuth(rxcall))) {
-       DBHOLD(dbase);
-       goto failed;
+       return code;
     }
 
     /* next, we do a sanity check to see if the guy sending us the database is
@@ -483,9 +482,12 @@ SDISK_SendFile(struct rx_call *rxcall, afs_int32 file,
     otherHost = ubikGetPrimaryInterfaceAddr(rx_HostOf(tpeer));
     if (offset && offset != otherHost) {
        /* we *know* this is the wrong guy */
-       code = USYNC;
-       DBHOLD(dbase);
-       goto failed;
+        char sync_hoststr[16];
+       ubik_print
+           ("Ubik: Refusing synchronization with server %s since it is not the sync-site (%s).\n",
+            afs_inet_ntoa_r(otherHost, hoststr),
+            afs_inet_ntoa_r(offset, sync_hoststr));
+       return USYNC;
     }
 
     DBHOLD(dbase);
@@ -596,6 +598,7 @@ failed:
            ("Ubik: Synchronize database with server %s failed (error = %d)\n",
             afs_inet_ntoa_r(otherHost, hoststr), code);
     } else {
+       uvote_set_dbVersion(*avers);
        ubik_print("Ubik: Synchronize database completed\n");
     }
     DBRELE(dbase);