volser-retry-transaction-creation-20090526
[openafs.git] / src / volser / vsprocs.c
index 75a7c1a..03ba43c 100644 (file)
@@ -55,14 +55,16 @@ RCSID
 #include <afs/procmgmt.h>      /* signal(), kill(), wait(), etc. */
 #include <setjmp.h>
 
-#include <volser_prototypes.h>
+#include "volser_prototypes.h"
+#include "vsutils_prototypes.h"
+#include "lockprocs_prototypes.h"
 
 struct ubik_client *cstruct;
-int verbose = 0;
+int verbose = 0, noresolve = 0;
 
 struct release {
-    afs_int32 crtime;
-    afs_int32 uptime;
+    afs_uint32 crtime;
+    afs_uint32 uptime;
     afs_int32 vldbEntryIndex;
 };
 
@@ -160,9 +162,9 @@ do { \
 
 /* Protos for static routines */
 static afs_int32 CheckAndDeleteVolume(struct rx_connection *aconn,
-                                     afs_int32 apart, afs_int32 okvol,
-                                     afs_int32 delvol);
-static int DelVol(struct rx_connection *conn, afs_int32 vid, afs_int32 part,
+                                     afs_int32 apart, afs_uint32 okvol,
+                                     afs_uint32 delvol);
+static int DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part,
                  afs_int32 flags);
 static int GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
                    struct rx_connection **connPtr, afs_int32 * transPtr,
@@ -446,19 +448,61 @@ UV_Bind(afs_int32 aserver, afs_int32 port)
     return tc;
 }
 
+static int 
+AFSVolCreateVolume_retry(struct rx_connection *z_conn,
+                      afs_int32 partition, char *name, afs_int32 type,
+                      afs_int32 parent, afs_int32 *volid, afs_int32 *trans)
+{
+    afs_int32 code;
+    int retries = 3;
+    while (retries) {
+       code = AFSVolCreateVolume(z_conn, partition, name, type, parent,
+                                 volid, trans);
+        if (code != VOLSERVOLBUSY)
+            break;
+        retries--;
+#ifdef AFS_PTHREAD_ENV
+        sleep(3-retries);
+#else
+        IOMGR_Sleep(3-retries);
+#endif
+    }
+    return code;
+}
+
+static int 
+AFSVolTransCreate_retry(struct rx_connection *z_conn,
+                       afs_int32 volume, afs_int32 partition, 
+                       afs_int32 flags, afs_int32 * trans) 
+{
+    afs_int32 code;
+    int retries = 3;
+    while (retries) {
+       code = AFSVolTransCreate(z_conn, volume, partition, flags, trans);
+        if (code != VOLSERVOLBUSY)
+            break;
+        retries--;
+#ifdef AFS_PTHREAD_ENV
+        sleep(3-retries);
+#else
+        IOMGR_Sleep(3-retries);
+#endif
+    }
+    return code;
+}
+
 /* if <okvol> is allright(indicated by beibg able to
  * start a transaction, delete the <delvol> */
 static afs_int32
 CheckAndDeleteVolume(struct rx_connection *aconn, afs_int32 apart,
-                    afs_int32 okvol, afs_int32 delvol)
+                    afs_uint32 okvol, afs_uint32 delvol)
 {
     afs_int32 error, code, tid, rcode;
-
     error = 0;
     code = 0;
 
     if (okvol == 0) {
-       code = AFSVolTransCreate(aconn, delvol, apart, ITOffline, &tid);
+       code = AFSVolTransCreate_retry(aconn, delvol, apart, ITOffline, &tid);
        if (!error && code)
            error = code;
        code = AFSVolDeleteVolume(aconn, tid);
@@ -471,14 +515,14 @@ CheckAndDeleteVolume(struct rx_connection *aconn, afs_int32 apart,
            error = code;
        return error;
     } else {
-       code = AFSVolTransCreate(aconn, okvol, apart, ITOffline, &tid);
+       code = AFSVolTransCreate_retry(aconn, okvol, apart, ITOffline, &tid);
        if (!code) {
            code = AFSVolEndTrans(aconn, tid, &rcode);
            if (!code)
                code = rcode;
            if (!error && code)
                error = code;
-           code = AFSVolTransCreate(aconn, delvol, apart, ITOffline, &tid);
+           code = AFSVolTransCreate_retry(aconn, delvol, apart, ITOffline, &tid);
            if (!error && code)
                error = code;
            code = AFSVolDeleteVolume(aconn, tid);
@@ -502,6 +546,7 @@ SubEnumerateEntry(struct nvldbentry *entry)
     int i;
     char pname[10];
     int isMixed = 0;
+    char hoststr[16];
 
 #ifdef notdef
     fprintf(STDOUT, "  readWriteID %-10u ", entry->volumeId[RWVOL]);
@@ -541,7 +586,8 @@ SubEnumerateEntry(struct nvldbentry *entry)
     for (i = 0; i < entry->nServers; i++) {
        MapPartIdIntoName(entry->serverPartition[i], pname);
        fprintf(STDOUT, "       server %s partition %s ",
-               hostutil_GetNameByINet(entry->serverNumber[i]), pname);
+               noresolve ? afs_inet_ntoa_r(entry->serverNumber[i], hoststr) : 
+                hostutil_GetNameByINet(entry->serverNumber[i]), pname);
        if (entry->serverFlags[i] & ITSRWVOL)
            fprintf(STDOUT, "RW Site ");
        else
@@ -576,7 +622,7 @@ EnumerateEntry(struct nvldbentry *entry)
 
 /* forcibly remove a volume.  Very dangerous call */
 int
-UV_NukeVolume(afs_int32 server, afs_int32 partid, afs_int32 volid)
+UV_NukeVolume(afs_int32 server, afs_int32 partid, afs_uint32 volid)
 {
     register struct rx_connection *tconn;
     register afs_int32 code;
@@ -626,7 +672,7 @@ UV_PartitionInfo64(afs_int32 server, char *pname,
 /* old interface to create volume */
 int
 UV_CreateVolume(afs_int32 aserver, afs_int32 apart, char *aname,
-               afs_int32 * anewid)
+               afs_uint32 * anewid)
 {
     afs_int32 code;
     code = UV_CreateVolume2(aserver, apart, aname, 5000, 0, 0, 0, 0, anewid);
@@ -638,9 +684,8 @@ UV_CreateVolume(afs_int32 aserver, afs_int32 apart, char *aname,
 int
 UV_CreateVolume2(afs_int32 aserver, afs_int32 apart, char *aname,
                 afs_int32 aquota, afs_int32 aspare1, afs_int32 aspare2,
-                afs_int32 aspare3, afs_int32 aspare4, afs_int32 * anewid)
+                afs_int32 aspare3, afs_int32 aspare4, afs_uint32 * anewid)
 {
-
     register struct rx_connection *aconn;
     afs_int32 tid;
     register afs_int32 code;
@@ -660,10 +705,9 @@ UV_CreateVolume2(afs_int32 aserver, afs_int32 apart, char *aname,
     /* next the next 3 available ids from the VLDB */
     vcode = ubik_VL_GetNewVolumeId(cstruct, 0, 3, anewid);
     EGOTO1(cfail, vcode, "Could not get an Id for volume %s\n", aname);
-
     code =
-       AFSVolCreateVolume(aconn, apart, aname, volser_RW, 0, anewid, &tid);
-    EGOTO2(cfail, vcode, "Failed to create the volume %s %u \n", aname,
+      AFSVolCreateVolume_retry(aconn, apart, aname, volser_RW, 0, anewid, &tid);
+    EGOTO2(cfail, code, "Failed to create the volume %s %u \n", aname,
           *anewid);
 
     code = AFSVolSetInfo(aconn, tid, &tstatus);
@@ -728,15 +772,13 @@ UV_CreateVolume2(afs_int32 aserver, afs_int32 apart, char *aname,
        rx_DestroyConnection(aconn);
     PrintError("", error);
     return error;
-
-
 }
 
 /* create a volume, given a server, partition number, volume name --> sends
 * back new vol id in <anewid>*/
 int
 UV_AddVLDBEntry(afs_int32 aserver, afs_int32 apart, char *aname,
-               afs_int32 aid)
+               afs_uint32 aid)
 {
     register struct rx_connection *aconn;
     afs_int32 error;
@@ -790,7 +832,7 @@ UV_AddVLDBEntry(afs_int32 aserver, afs_int32 apart, char *aname,
  * becomes zero
  */
 int
-UV_DeleteVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
+UV_DeleteVolume(afs_int32 aserver, afs_int32 apart, afs_uint32 avolid)
 {
     struct rx_connection *aconn = (struct rx_connection *)0;
     afs_int32 ttid = 0;
@@ -823,7 +865,7 @@ UV_DeleteVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
 
     /* Whether volume is in the VLDB or not. Delete the volume on disk */
     aconn = UV_Bind(aserver, AFSCONF_VOLUMEPORT);
-    code = AFSVolTransCreate(aconn, avolid, apart, ITOffline, &ttid);
+    code = AFSVolTransCreate_retry(aconn, avolid, apart, ITOffline, &ttid);
     if (code) {
        if (code == VNOVOL) {
            notondisk = 1;
@@ -902,8 +944,9 @@ UV_DeleteVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
 
        /* Delete backup if it exists */
        code =
-           AFSVolTransCreate(aconn, entry.volumeId[BACKVOL], apart,
-                             ITOffline, &ttid);
+           AFSVolTransCreate_retry(aconn, entry.volumeId[BACKVOL], apart,
+                                   ITOffline, &ttid);
+
        if (!code) {
            if (verbose) {
                fprintf(STDOUT, "Trying to delete the backup volume %u ...",
@@ -1051,7 +1094,7 @@ sigint_handler(int x)
  */
 
 int
-UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_MoveVolume2(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
               afs_int32 atoserver, afs_int32 atopart, int flags)
 {
     struct rx_connection *toconn, *fromconn;
@@ -1063,7 +1106,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     afs_int32 fromDate;
     struct restoreCookie cookie;
     register afs_int32 vcode, code;
-    afs_int32 newVol, volid, backupId;
+    afs_uint32 newVol, volid, backupId;
     struct volser_status tstatus;
     struct destServer destination;
 
@@ -1072,6 +1115,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     afs_int32 error;
     char in, lf;               /* for test code */
     int same;
+    char hoststr[16];
 
 #ifdef ENABLE_BUGFIX_1165
     volEntries volumeInfo;
@@ -1148,7 +1192,8 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
                    char pname[10];
                    MapPartIdIntoName(entry.serverPartition[i], pname);
                    fprintf(STDERR, " server %s partition %s \n",
-                           hostutil_GetNameByINet(entry.serverNumber[i]),
+                           noresolve ? afs_inet_ntoa_r(entry.serverNumber[i], hoststr) :
+                            hostutil_GetNameByINet(entry.serverNumber[i]),
                            pname);
                }
            }
@@ -1173,8 +1218,9 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
        pntg = 1;
 
        code =
-           AFSVolTransCreate(fromconn, afromvol, afrompart, ITOffline,
-                             &fromtid);
+           AFSVolTransCreate_retry(fromconn, afromvol, afrompart, ITOffline,
+                                   &fromtid);
+
        if (!code) {            /* volume exists - delete it */
            VPRINT1("Setting flags on leftover source volume %u ...",
                    afromvol);
@@ -1208,8 +1254,9 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
        /*delete the backup volume now */
        fromtid = 0;
        code =
-           AFSVolTransCreate(fromconn, backupId, afrompart, ITOffline,
-                             &fromtid);
+           AFSVolTransCreate_retry(fromconn, backupId, afrompart, ITOffline,
+                                   &fromtid);
+
        if (!code) {            /* backup volume exists - delete it */
            VPRINT1("Setting flags on leftover backup volume %u ...",
                    backupId);
@@ -1271,7 +1318,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
      * ***/
 
     VPRINT1("Starting transaction on source volume %u ...", afromvol);
-    code = AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy, &fromtid);
+    code = AFSVolTransCreate_retry(fromconn, afromvol, afrompart, ITBusy, &fromtid);
     EGOTO1(mfail, code, "Failed to create transaction on the volume %u\n",
           afromvol);
     VDONE;
@@ -1322,7 +1369,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
        /* All of this is to get the fromDate */
        VPRINT1("Starting transaction on the cloned volume %u ...", newVol);
        code =
-           AFSVolTransCreate(fromconn, newVol, afrompart, ITOffline,
+           AFSVolTransCreate_retry(fromconn, newVol, afrompart, ITOffline,
                              &clonetid);
        EGOTO1(mfail, code,
               "Failed to start a transaction on the cloned volume%u\n",
@@ -1373,7 +1420,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
 
     /* create a volume on the target machine */
     volid = afromvol;
-    code = AFSVolTransCreate(toconn, volid, atopart, ITOffline, &totid);
+    code = AFSVolTransCreate_retry(toconn, volid, atopart, ITOffline, &totid);
     if (!code) {
        /* Delete the existing volume.
         * While we are deleting the volume in these steps, the transaction
@@ -1458,7 +1505,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
      * ***/
 
     VPRINT1("Starting transaction on source volume %u ...", afromvol);
-    code = AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy, &fromtid);
+    code = AFSVolTransCreate_retry(fromconn, afromvol, afrompart, ITBusy, &fromtid);
     EGOTO1(mfail, code,
           "Failed to create a transaction on the source volume %u\n",
           afromvol);
@@ -1610,7 +1657,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     VPRINT1("Creating transaction for backup volume %u on source ...",
            backupId);
     code =
-       AFSVolTransCreate(fromconn, backupId, afrompart, ITOffline, &fromtid);
+       AFSVolTransCreate_retry(fromconn, backupId, afrompart, ITOffline, &fromtid);
     VDONE;
     if (!code) {
        VPRINT1("Setting flags on backup volume %u on source ...", backupId);
@@ -1646,7 +1693,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     if (!(flags & RV_NOCLONE)) {
        VPRINT1("Starting transaction on the cloned volume %u ...", newVol);
        code =
-           AFSVolTransCreate(fromconn, newVol, afrompart, ITOffline,
+           AFSVolTransCreate_retry(fromconn, newVol, afrompart, ITOffline,
                              &clonetid);
        EGOTO1(mfail, code,
               "Failed to start a transaction on the cloned volume%u\n",
@@ -1784,6 +1831,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
        ubik_VL_ReleaseLock(cstruct, 0, afromvol, -1,
                  (LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
        VDONE;
+       islocked = 0;
     }
 
     if (clonetid) {
@@ -1832,7 +1880,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
                ("Recovery: Creating transaction for destination volume %u ...",
                 volid);
            code =
-               AFSVolTransCreate(toconn, volid, atopart, ITOffline, &totid);
+               AFSVolTransCreate_retry(toconn, volid, atopart, ITOffline, &totid);
 
            if (!code) {
                VDONE;
@@ -1866,7 +1914,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
            VPRINT1("Recovery: Creating transaction on source volume %u ...",
                    afromvol);
            code =
-               AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy,
+               AFSVolTransCreate_retry(fromconn, afromvol, afrompart, ITBusy,
                                  &fromtid);
            if (!code) {
                VDONE;
@@ -1899,7 +1947,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
            VPRINT1("Recovery: Creating transaction on backup volume %u ...",
                    backupId);
            code =
-               AFSVolTransCreate(fromconn, backupId, afrompart, ITOffline,
+               AFSVolTransCreate_retry(fromconn, backupId, afrompart, ITOffline,
                                  &fromtid);
            if (!code) {
                VDONE;
@@ -1929,7 +1977,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
            VPRINT1("Recovery: Creating transaction on source volume %u ...",
                    afromvol);
            code =
-               AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy,
+               AFSVolTransCreate_retry(fromconn, afromvol, afrompart, ITBusy,
                                  &fromtid);
            if (!code) {
                VDONE;
@@ -1968,7 +2016,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
        VPRINT1("Recovery: Creating transaction on clone volume %u ...",
                newVol);
        code =
-           AFSVolTransCreate(fromconn, newVol, afrompart, ITOffline,
+           AFSVolTransCreate_retry(fromconn, newVol, afrompart, ITOffline,
                              &clonetid);
        if (!code) {
            VDONE;
@@ -1989,12 +2037,14 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     }
 
     /* unlock VLDB entry */
-    VPRINT1("Recovery: Releasing lock on VLDB entry for volume %u ...",
-           afromvol);
-    ubik_VL_ReleaseLock(cstruct, 0, afromvol, -1,
-             (LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
-    VDONE;
-
+    if (islocked) {
+       VPRINT1("Recovery: Releasing lock on VLDB entry for volume %u ...",
+               afromvol);
+       ubik_VL_ReleaseLock(cstruct, 0, afromvol, -1,
+                           (LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
+       VDONE;
+       islocked = 0;
+    }
   done:                        /* routine cleanup */
     if (volName)
        free(volName);
@@ -2016,7 +2066,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
 
 
 int
-UV_MoveVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_MoveVolume(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
              afs_int32 atoserver, afs_int32 atopart)
 {
     return UV_MoveVolume2(afromvol, afromserver, afrompart,
@@ -2036,9 +2086,9 @@ UV_MoveVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
  *     RV_NOCLONE - don't use a copy clone
  */
 int
-UV_CopyVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_CopyVolume2(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
               char *atovolname, afs_int32 atoserver, afs_int32 atopart,
-              afs_int32 atovolid, int flags)
+              afs_uint32 atovolid, int flags)
 {
     struct rx_connection *toconn, *fromconn;
     afs_int32 fromtid, totid, clonetid;
@@ -2047,7 +2097,8 @@ UV_CopyVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     afs_int32 fromDate, cloneFromDate;
     struct restoreCookie cookie;
     register afs_int32 vcode, code;
-    afs_int32 cloneVol, newVol, volflag;
+    afs_uint32 cloneVol, newVol;
+    afs_int32 volflag;
     struct volser_status tstatus;
     struct destServer destination;
 
@@ -2095,7 +2146,7 @@ UV_CopyVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     cloneVol = 0;
     if (!(flags & RV_NOCLONE)) {
        VPRINT1("Starting transaction on source volume %u ...", afromvol);
-       code = AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy,
+       code = AFSVolTransCreate_retry(fromconn, afromvol, afrompart, ITBusy,
                                 &fromtid);
        EGOTO1(mfail, code, "Failed to create transaction on the volume %u\n",
               afromvol);
@@ -2155,7 +2206,7 @@ UV_CopyVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     if (!(flags & RV_NOCLONE)) {
        VPRINT1("Starting transaction on the cloned volume %u ...", cloneVol);
        code =
-           AFSVolTransCreate(fromconn, cloneVol, afrompart, ITOffline,
+           AFSVolTransCreate_retry(fromconn, cloneVol, afrompart, ITOffline,
                          &clonetid);
        EGOTO1(mfail, code,
               "Failed to start a transaction on the cloned volume%u\n",
@@ -2185,7 +2236,7 @@ UV_CopyVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
 
     /* create a volume on the target machine */
     cloneFromDate = 0;
-    code = AFSVolTransCreate(toconn, newVol, atopart, ITOffline, &totid);
+    code = AFSVolTransCreate_retry(toconn, newVol, atopart, ITOffline, &totid);
     if (!code) {
        if ((flags & RV_CPINCR)) {
            VPRINT1("Getting status of pre-existing volume %u ...", newVol);
@@ -2294,7 +2345,7 @@ cpincr:
      * ***/
 
     VPRINT1("Starting transaction on source volume %u ...", afromvol);
-    code = AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy, &fromtid);
+    code = AFSVolTransCreate_retry(fromconn, afromvol, afrompart, ITBusy, &fromtid);
     EGOTO1(mfail, code,
           "Failed to create a transaction on the source volume %u\n",
           afromvol);
@@ -2346,7 +2397,7 @@ cpincr:
     if (!(flags & RV_NOCLONE)) {
        VPRINT1("Starting transaction on the cloned volume %u ...", cloneVol);
        code =
-           AFSVolTransCreate(fromconn, cloneVol, afrompart, ITOffline,
+           AFSVolTransCreate_retry(fromconn, cloneVol, afrompart, ITOffline,
                              &clonetid);
        EGOTO1(mfail, code,
               "Failed to start a transaction on the cloned volume%u\n",
@@ -2495,7 +2546,7 @@ cpincr:
        VPRINT1("Recovery: Creating transaction on clone volume %u ...",
                cloneVol);
        code =
-           AFSVolTransCreate(fromconn, cloneVol, afrompart, ITOffline,
+           AFSVolTransCreate_retry(fromconn, cloneVol, afrompart, ITOffline,
                              &clonetid);
        if (!code) {
            VDONE;
@@ -2530,7 +2581,7 @@ cpincr:
 
 
 int
-UV_CopyVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_CopyVolume(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
              char *atovolname, afs_int32 atoserver, afs_int32 atopart)
 {
     return UV_CopyVolume2(afromvol, afromserver, afrompart,
@@ -2544,11 +2595,11 @@ UV_CopyVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
  */
 
 int
-UV_BackupVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
+UV_BackupVolume(afs_int32 aserver, afs_int32 apart, afs_uint32 avolid)
 {
     struct rx_connection *aconn = (struct rx_connection *)0;
     afs_int32 ttid = 0, btid = 0;
-    afs_int32 backupID;
+    afs_uint32 backupID;
     afs_int32 code = 0, rcode = 0;
     char vname[VOLSER_MAXVOLNAME + 1];
     struct nvldbentry entry, storeEntry;
@@ -2625,7 +2676,7 @@ UV_BackupVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
     /* Test to see if the backup volume exists by trying to create
      * a transaction on the backup volume. We've assumed the backup exists.
      */
-    code = AFSVolTransCreate(aconn, backupID, apart, ITOffline, &btid);
+    code = AFSVolTransCreate_retry(aconn, backupID, apart, ITOffline, &btid);
     if (code) {
        if (code != VNOVOL) {
            fprintf(STDERR, "Could not reach the backup volume %lu\n",
@@ -2650,7 +2701,7 @@ UV_BackupVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
     /* Now go ahead and try to clone the RW volume.
      * First start a transaction on the RW volume 
      */
-    code = AFSVolTransCreate(aconn, avolid, apart, ITBusy, &ttid);
+    code = AFSVolTransCreate_retry(aconn, avolid, apart, ITBusy, &ttid);
     if (code) {
        fprintf(STDERR, "Could not start a transaction on the volume %lu\n",
                (unsigned long)avolid);
@@ -2704,7 +2755,7 @@ UV_BackupVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
     }
 
     /* Now go back to the backup volume and bring it on line */
-    code = AFSVolTransCreate(aconn, backupID, apart, ITOffline, &btid);
+    code = AFSVolTransCreate_retry(aconn, backupID, apart, ITOffline, &btid);
     if (code) {
        fprintf(STDERR,
                "Failed to start a transaction on the backup volume %lu\n",
@@ -2805,8 +2856,8 @@ UV_BackupVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
  */
 
 int
-UV_CloneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid,
-              afs_int32 acloneid, char *aname, int flags)
+UV_CloneVolume(afs_int32 aserver, afs_int32 apart, afs_uint32 avolid,
+              afs_uint32 acloneid, char *aname, int flags)
 {
     struct rx_connection *aconn = (struct rx_connection *)0;
     afs_int32 ttid = 0, btid = 0;
@@ -2852,7 +2903,7 @@ UV_CloneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid,
      * a transaction on the clone volume. We've assumed the clone exists.
      */
     /* XXX I wonder what happens if the clone has some other parent... */
-    code = AFSVolTransCreate(aconn, acloneid, apart, ITOffline, &btid);
+    code = AFSVolTransCreate_retry(aconn, acloneid, apart, ITOffline, &btid);
     if (code) {
        if (code != VNOVOL) {
            fprintf(STDERR, "Could not reach the clone volume %lu\n",
@@ -2877,7 +2928,7 @@ UV_CloneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid,
     /* Now go ahead and try to clone the RW volume.
      * First start a transaction on the RW volume 
      */
-    code = AFSVolTransCreate(aconn, avolid, apart, ITBusy, &ttid);
+    code = AFSVolTransCreate_retry(aconn, avolid, apart, ITBusy, &ttid);
     if (code) {
        fprintf(STDERR, "Could not start a transaction on the volume %lu\n",
                (unsigned long)avolid);
@@ -2925,7 +2976,7 @@ UV_CloneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid,
 
     /* Now go back to the backup volume and bring it on line */
     if (!(flags & RV_OFFLINE)) {
-       code = AFSVolTransCreate(aconn, acloneid, apart, ITOffline, &btid);
+       code = AFSVolTransCreate_retry(aconn, acloneid, apart, ITOffline, &btid);
        if (code) {
            fprintf(STDERR,
                    "Failed to start a transaction on the clone volume %lu\n",
@@ -2985,13 +3036,13 @@ UV_CloneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid,
 }
 
 static int
-DelVol(struct rx_connection *conn, afs_int32 vid, afs_int32 part,
+DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part,
        afs_int32 flags)
 {
     afs_int32 acode, ccode, rcode, tid;
     ccode = rcode = tid = 0;
 
-    acode = AFSVolTransCreate(conn, vid, part, flags, &tid);
+    acode = AFSVolTransCreate_retry(conn, vid, part, flags, &tid);
     if (!acode) {              /* It really was there */
        acode = AFSVolDeleteVolume(conn, tid);
        if (acode) {
@@ -3024,9 +3075,11 @@ GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
         struct rx_connection **connPtr, afs_int32 * transPtr,
         afs_int32 * crtimePtr, afs_int32 * uptimePtr)
 {
-    afs_int32 volid;
+    afs_uint32 volid;
     struct volser_status tstatus;
-    int code, rcode, tcode;
+    int code = 0;
+    int rcode, tcode;
+    char hoststr[16];
 
     *connPtr = (struct rx_connection *)0;
     *transPtr = 0;
@@ -3041,13 +3094,14 @@ GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
     volid = vldbEntryPtr->volumeId[ROVOL];
     if (volid)
        code =
-           AFSVolTransCreate(*connPtr, volid,
+           AFSVolTransCreate_retry(*connPtr, volid,
                              vldbEntryPtr->serverPartition[index], ITOffline,
                              transPtr);
 
     /* If the volume does not exist, create it */
     if (!volid || code) {
        char volname[64];
+        char hoststr[16];
 
        if (volid && (code != VNOVOL)) {
            PrintError("Failed to start a transaction on the RO volume.\n",
@@ -3062,7 +3116,9 @@ GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
            fprintf(STDOUT,
                    "Creating new volume %lu on replication site %s: ",
                    (unsigned long)volid,
-                   hostutil_GetNameByINet(vldbEntryPtr->
+                    noresolve ? afs_inet_ntoa_r(vldbEntryPtr->
+                                                serverNumber[index], hoststr) :
+                    hostutil_GetNameByINet(vldbEntryPtr->
                                           serverNumber[index]));
            fflush(STDOUT);
        }
@@ -3095,7 +3151,9 @@ GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
      */
     else {
        VPRINT2("Updating existing ro volume %u on %s ...\n", volid,
-               hostutil_GetNameByINet(vldbEntryPtr->serverNumber[index]));
+                noresolve ? afs_inet_ntoa_r(vldbEntryPtr->
+                                            serverNumber[index], hoststr) : 
+                hostutil_GetNameByINet(vldbEntryPtr->serverNumber[index]));
 
        code = AFSVolGetStatus(*connPtr, *transPtr, &tstatus);
        if (code) {
@@ -3127,7 +3185,7 @@ SimulateForwardMultiple(struct rx_connection *fromconn, afs_int32 fromtid,
                        afs_int32 fromdate, manyDests * tr, afs_int32 flags,
                        void *cookie, manyResults * results)
 {
-    int i;
+    unsigned int i;
 
     for (i = 0; i < tr->manyDests_len; i++) {
        results->manyResults_val[i] =
@@ -3154,12 +3212,13 @@ SimulateForwardMultiple(struct rx_connection *fromconn, afs_int32 fromtid,
  */
 
 int
-UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
+UV_ReleaseVolume(afs_uint32 afromvol, afs_int32 afromserver,
                 afs_int32 afrompart, int forceflag)
 {
     char vname[64];
-    afs_int32 code, vcode, rcode, tcode;
-    afs_int32 cloneVolId, roVolId;
+    afs_int32 code = 0;
+    afs_int32 vcode, rcode, tcode;
+    afs_uint32 cloneVolId, roVolId;
     struct replica *replicas = 0;
     struct nvldbentry entry, storeEntry;
     int i, volcount, m, fullrelease, vldbindex;
@@ -3173,19 +3232,22 @@ UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
     int islocked = 0;
     afs_int32 clonetid = 0, onlinetid;
     afs_int32 fromtid = 0;
-    afs_uint32 fromdate, thisdate;
+    afs_uint32 fromdate = 0;
+    afs_uint32 thisdate;
     time_t tmv;
     int s;
     manyDests tr;
     manyResults results;
     int rwindex, roindex, roclone, roexists;
-    afs_int32 rwcrdate, rwupdate, clcrdate;
+    afs_uint32 rwcrdate = 0;
+    afs_uint32 rwupdate, clcrdate;
     struct rtime {
        int validtime;
        afs_uint32 uptime;
     } remembertime[NMAXNSERVERS];
     int releasecount = 0;
     struct volser_status volstatus;
+    char hoststr[16];
 
     memset((char *)remembertime, 0, sizeof(remembertime));
     memset((char *)&results, 0, sizeof(results));
@@ -3268,7 +3330,7 @@ UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
            fullrelease = 1;    /* Do a full release if RO clone does not exist */
        else {
            /* Begin transaction on RW and mark it busy while we query it */
-           code = AFSVolTransCreate(
+           code = AFSVolTransCreate_retry(
                        fromconn, afromvol, afrompart, ITBusy, &fromtid
                   );
            ONERROR(code, afromvol,
@@ -3288,7 +3350,7 @@ UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
                    "Failed to end transaction on RW volume %u\n");
 
            /* Begin transaction on clone and mark it busy while we query it */
-           code = AFSVolTransCreate(
+           code = AFSVolTransCreate_retry(
                        fromconn, cloneVolId, afrompart, ITBusy, &clonetid
                   );
            ONERROR(code, cloneVolId,
@@ -3354,7 +3416,7 @@ UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
 
        /* Begin transaction on RW and mark it busy while we clone it */
        code =
-           AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy,
+           AFSVolTransCreate_retry(fromconn, afromvol, afrompart, ITBusy,
                              &clonetid);
        ONERROR(code, afromvol, "Failed to start transaction on volume %u\n");
 
@@ -3405,7 +3467,7 @@ UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
            VPRINT1("Starting transaction on RO clone volume %u...",
                    cloneVolId);
            code =
-               AFSVolTransCreate(fromconn, cloneVolId, afrompart, ITOffline,
+               AFSVolTransCreate_retry(fromconn, cloneVolId, afrompart, ITOffline,
                                  &onlinetid);
            ONERROR(code, cloneVolId,
                    "Failed to start transaction on volume %u\n");
@@ -3490,7 +3552,7 @@ UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
     /* Create a transaction on the cloned volume */
     VPRINT1("Starting transaction on cloned volume %u...", cloneVolId);
     code =
-       AFSVolTransCreate(fromconn, cloneVolId, afrompart, ITBusy, &fromtid);
+       AFSVolTransCreate_retry(fromconn, cloneVolId, afrompart, ITBusy, &fromtid);
     if (!fullrelease && code)
        ONERROR(VOLSERNOVOL, afromvol,
                "Old clone is inaccessible. Try vos release -f %u.\n");
@@ -3589,13 +3651,17 @@ UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
        if (verbose) {
            fprintf(STDOUT, "Starting ForwardMulti from %lu to %u on %s",
                    (unsigned long)cloneVolId, entry.volumeId[ROVOL],
-                   hostutil_GetNameByINet(entry.
+                    noresolve ? afs_inet_ntoa_r(entry.serverNumber[times[0].
+                                                vldbEntryIndex], hoststr) :
+                    hostutil_GetNameByINet(entry.
                                           serverNumber[times[0].
                                                        vldbEntryIndex]));
 
            for (s = 1; s < volcount; s++) {
                fprintf(STDOUT, " and %s",
-                       hostutil_GetNameByINet(entry.
+                        noresolve ? afs_inet_ntoa_r(entry.serverNumber[times[s].
+                                                    vldbEntryIndex], hoststr) :
+                        hostutil_GetNameByINet(entry.
                                               serverNumber[times[s].
                                                            vldbEntryIndex]));
            }
@@ -3724,7 +3790,8 @@ UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
            if (!(entry.serverFlags[i] & NEW_REPSITE)) {
                MapPartIdIntoName(entry.serverPartition[i], pname);
                fprintf(STDERR, "\t%35s %s\n",
-                       hostutil_GetNameByINet(entry.serverNumber[i]), pname);
+                        noresolve ? afs_inet_ntoa_r(entry.serverNumber[i], hoststr) :
+                        hostutil_GetNameByINet(entry.serverNumber[i]), pname);
            }
        }
 
@@ -3795,9 +3862,10 @@ UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
                fprintf(STDERR,
                        "Failed to end transaction on ro volume %u at server %s\n",
                        entry.volumeId[ROVOL],
-                       hostutil_GetNameByINet(htonl
-                                              (replicas[i].server.
-                                               destHost)));
+                        noresolve ? afs_inet_ntoa_r(htonl(replicas[i].server.
+                                                        destHost), hoststr) :
+                        hostutil_GetNameByINet(htonl
+                                              (replicas[i].server.destHost)));
                if (!error)
                    error = code;
            }
@@ -3849,7 +3917,7 @@ dump_sig_handler(int x)
  * extracting parameters from the rock 
  */
 int
-UV_DumpVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_DumpVolume(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
              afs_int32 fromdate, afs_int32(*DumpFunction) (), char *rock,
              afs_int32 flags)
 {
@@ -3877,7 +3945,7 @@ UV_DumpVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     fromconn = UV_Bind(afromserver, AFSCONF_VOLUMEPORT);
 
     VEPRINT1("Starting transaction on volume %u...", afromvol);
-    code = AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy, &fromtid);
+    code = AFSVolTransCreate_retry(fromconn, afromvol, afrompart, ITBusy, &fromtid);
     EGOTO1(error_exit, code,
           "Could not start transaction on the volume %u to be dumped\n",
           afromvol);
@@ -3937,7 +4005,7 @@ UV_DumpVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
  * extracting parameters from the rock 
  */
 int
-UV_DumpClonedVolume(afs_int32 afromvol, afs_int32 afromserver,
+UV_DumpClonedVolume(afs_uint32 afromvol, afs_int32 afromserver,
                    afs_int32 afrompart, afs_int32 fromdate,
                    afs_int32(*DumpFunction) (), char *rock, afs_int32 flags)
 {
@@ -3946,7 +4014,7 @@ UV_DumpClonedVolume(afs_int32 afromvol, afs_int32 afromserver,
     afs_int32 fromtid = 0, rxError = 0, rcode = 0;
     afs_int32 clonetid = 0;
     afs_int32 code = 0, vcode = 0, error = 0;
-    afs_int32 clonevol = 0;
+    afs_uint32 clonevol = 0;
     char vname[64];
     time_t tmv = fromdate;
 
@@ -3968,7 +4036,7 @@ UV_DumpClonedVolume(afs_int32 afromvol, afs_int32 afromserver,
     fromconn = UV_Bind(afromserver, AFSCONF_VOLUMEPORT);
 
     VEPRINT1("Starting transaction on volume %u...", afromvol);
-    code = AFSVolTransCreate(fromconn, afromvol, afrompart, ITBusy, &fromtid);
+    code = AFSVolTransCreate_retry(fromconn, afromvol, afrompart, ITBusy, &fromtid);
     EGOTO1(error_exit, code,
           "Could not start transaction on the volume %u to be dumped\n",
           afromvol);
@@ -4005,7 +4073,7 @@ UV_DumpClonedVolume(afs_int32 afromvol, afs_int32 afromserver,
 
     VEPRINT1("Starting transaction on the cloned volume %u ...", clonevol);
     code =
-       AFSVolTransCreate(fromconn, clonevol, afrompart, ITOffline,
+       AFSVolTransCreate_retry(fromconn, clonevol, afrompart, ITOffline,
                          &clonetid);
     EGOTO1(error_exit, code,
           "Failed to start a transaction on the cloned volume%u\n",
@@ -4080,7 +4148,7 @@ UV_DumpClonedVolume(afs_int32 afromvol, afs_int32 afromserver,
  * after extracting params from the rock 
  */
 int
-UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
+UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_uint32 tovolid,
                  afs_int32 toparentid, char tovolname[], int flags,
                  afs_int32(*WriteData) (), char *rock)
 {
@@ -4092,8 +4160,8 @@ UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
     struct volintInfo vinfo;
     char partName[10];
     char tovolreal[VOLSER_OLDMAXVOLNAME];
-    afs_int32 pvolid, pparentid;
-    afs_int32 temptid;
+    afs_uint32 pvolid; 
+    afs_int32 temptid, pparentid;
     int success;
     struct nvldbentry entry, storeEntry;
     afs_int32 error;
@@ -4104,7 +4172,7 @@ UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
     afs_int32 oldCreateDate, oldUpdateDate, newCreateDate, newUpdateDate;
     int index, same, errcode;
     char apartName[10];
-
+    char hoststr[16];
 
     memset(&cookie, 0, sizeof(cookie));
     islocked = 0;
@@ -4181,6 +4249,7 @@ UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
     MapPartIdIntoName(topart, partName);
     fprintf(STDOUT, "Restoring volume %s Id %lu on server %s partition %s ..",
            tovolreal, (unsigned long)pvolid,
+            noresolve ? afs_inet_ntoa_r(toserver, hoststr) :
            hostutil_GetNameByINet(toserver), partName);
     fflush(STDOUT);
     code =
@@ -4191,7 +4260,7 @@ UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
            VPRINT1("Deleting the previous volume %u ...", pvolid);
 
            code =
-               AFSVolTransCreate(toconn, pvolid, topart, ITOffline, &totid);
+               AFSVolTransCreate_retry(toconn, pvolid, topart, ITOffline, &totid);
            EGOTO1(refail, code, "Failed to start transaction on %u\n",
                   pvolid);
 
@@ -4225,7 +4294,7 @@ UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
            EGOTO1(refail, code, "Could not create new volume %u\n", pvolid);
        } else {
            code =
-               AFSVolTransCreate(toconn, pvolid, topart, ITOffline, &totid);
+               AFSVolTransCreate_retry(toconn, pvolid, topart, ITOffline, &totid);
            EGOTO1(refail, code, "Failed to start transaction on %u\n",
                   pvolid);
 
@@ -4432,6 +4501,7 @@ UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
                        VPRINT2
                            ("Not deleting the previous volume %u on server %s, ...",
                             pvolid,
+                             noresolve ? afs_inet_ntoa_r(entry.serverNumber[index], hoststr) :
                             hostutil_GetNameByINet(entry.serverNumber[index]));
                    } else {
                        tempconn =
@@ -4443,10 +4513,11 @@ UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
                        VPRINT3
                            ("Deleting the previous volume %u on server %s, partition %s ...",
                             pvolid,
+                             noresolve ? afs_inet_ntoa_r(entry.serverNumber[index], hoststr) :
                             hostutil_GetNameByINet(entry.serverNumber[index]),
                             apartName);
                        code =
-                           AFSVolTransCreate(tempconn, pvolid,
+                           AFSVolTransCreate_retry(tempconn, pvolid,
                                              entry.serverPartition[index],
                                              ITOffline, &temptid);
                        if (!code) {
@@ -4559,7 +4630,7 @@ UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
 }
 
 int
-UV_RestoreVolume(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
+UV_RestoreVolume(afs_int32 toserver, afs_int32 topart, afs_uint32 tovolid,
                 char tovolname[], int flags, afs_int32(*WriteData) (),
                 char *rock)
 {
@@ -4570,10 +4641,8 @@ UV_RestoreVolume(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
 
 /*unlocks the vldb entry associated with <volid> */
 int
-UV_LockRelease(afs_int32 volid)
+UV_LockRelease(afs_uint32 volid)
 {
-
-
     afs_int32 vcode;
 
     VPRINT("Binding to the VLDB server\n");
@@ -4595,7 +4664,7 @@ UV_LockRelease(afs_int32 volid)
 /*adds <server> and <part> as a readonly replication site for <volid>
 *in vldb */
 int
-UV_AddSite(afs_int32 server, afs_int32 part, afs_int32 volid, afs_int32 valid)
+UV_AddSite(afs_int32 server, afs_int32 part, afs_uint32 volid, afs_int32 valid)
 {
     int j, nro = 0, islocked = 0;
     struct nvldbentry entry, storeEntry;
@@ -4706,7 +4775,7 @@ UV_AddSite(afs_int32 server, afs_int32 part, afs_int32 volid, afs_int32 valid)
 
 /*removes <server> <part> as read only site for <volid> from the vldb */
 int
-UV_RemoveSite(afs_int32 server, afs_int32 part, afs_int32 volid)
+UV_RemoveSite(afs_int32 server, afs_int32 part, afs_uint32 volid)
 {
     afs_int32 vcode;
     struct nvldbentry entry, storeEntry;
@@ -4786,7 +4855,7 @@ UV_RemoveSite(afs_int32 server, afs_int32 part, afs_int32 volid)
 
 /*sets <server> <part> as read/write site for <volid> in the vldb */
 int
-UV_ChangeLocation(afs_int32 server, afs_int32 part, afs_int32 volid)
+UV_ChangeLocation(afs_int32 server, afs_int32 part, afs_uint32 volid)
 {
     afs_int32 vcode;
     struct nvldbentry entry, storeEntry;
@@ -4924,7 +4993,7 @@ UV_ZapVolumeClones(afs_int32 aserver, afs_int32 apart,
            curPtr->volFlags &= ~CLONEZAPPED;
            success = 1;
            code =
-               AFSVolTransCreate(aconn, curPtr->volCloneId, apart, ITOffline,
+               AFSVolTransCreate_retry(aconn, curPtr->volCloneId, apart, ITOffline,
                                  &tid);
            if (code)
                success = 0;
@@ -4966,7 +5035,7 @@ UV_GenerateVolumeClones(afs_int32 aserver, afs_int32 apart,
     afs_int32 rcode = 0;
     afs_int32 tid;
     int reuseCloneId = 0;
-    afs_int32 curCloneId = 0;
+    afs_uint32 curCloneId = 0;
     char cloneName[256];       /*max vol name */
 
     aconn = (struct rx_connection *)0;
@@ -4990,7 +5059,7 @@ UV_GenerateVolumeClones(afs_int32 aserver, afs_int32 apart,
            curPtr->volFlags |= CLONEVALID;
            /*make a clone of curParentId and record as curPtr->volCloneId */
            code =
-               AFSVolTransCreate(aconn, curPtr->volId, apart, ITOffline,
+               AFSVolTransCreate_retry(aconn, curPtr->volId, apart, ITOffline,
                                  &tid);
            if (code)
                VPRINT2("Clone for volume %s %u failed \n", curPtr->volName,
@@ -5156,7 +5225,7 @@ UV_XListVolumes(afs_int32 a_serverID, afs_int32 a_partID, int a_all,
 
 /* get all the information about volume <volid> on <aserver> and <apart> */
 int
-UV_ListOneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 volid,
+UV_ListOneVolume(afs_int32 aserver, afs_int32 apart, afs_uint32 volid,
                 struct volintInfo **resultPtr)
 {
     struct rx_connection *aconn;
@@ -5215,7 +5284,7 @@ UV_ListOneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 volid,
  *------------------------------------------------------------------------*/
 
 int
-UV_XListOneVolume(afs_int32 a_serverID, afs_int32 a_partID, afs_int32 a_volID,
+UV_XListOneVolume(afs_int32 a_serverID, afs_int32 a_partID, afs_uint32 a_volID,
                  struct volintXInfo **a_resultPP)
 {
     struct rx_connection *rxConnP;     /*Rx connection to Volume Server */
@@ -5280,12 +5349,14 @@ static afs_int32
 CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
            afs_int32 * modentry, afs_uint32 * maxvolid)
 {
-    int idx, j;
+    int idx = 0;
+    int j;
     afs_int32 code, error = 0;
     struct nvldbentry entry, storeEntry;
     char pname[10];
     int pass = 0, islocked = 0, createentry, addvolume, modified, mod, doit = 1;
-    afs_int32 rwvolid;
+    afs_uint32 rwvolid;
+    char hoststr[16]; 
 
     if (modentry) {
        if (*modentry == 1)
@@ -5374,12 +5445,16 @@ CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
                            fprintf(STDERR,
                                    "*** Warning: Orphaned RW volume %lu exists on %s %s\n",
                                    (unsigned long)rwvolid,
+                                    noresolve ?
+                                    afs_inet_ntoa_r(aserver, hoststr) :
                                    hostutil_GetNameByINet(aserver), pname);
                            MapPartIdIntoName(entry.serverPartition[idx],
                                              pname);
                            fprintf(STDERR,
                                    "    VLDB reports RW volume %lu exists on %s %s\n",
                                    (unsigned long)rwvolid,
+                                    noresolve ? 
+                                    afs_inet_ntoa_r(entry.serverNumber[idx], hoststr) :
                                    hostutil_GetNameByINet(entry.
                                                           serverNumber[idx]),
                                    pname);
@@ -5396,6 +5471,8 @@ CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
                                fprintf(STDERR,
                                        "*** Warning: Orphaned BK volume %u exists on %s %s\n",
                                        entry.volumeId[BACKVOL],
+                                        noresolve ?
+                                        afs_inet_ntoa_r(entry.serverNumber[idx], hoststr) :
                                        hostutil_GetNameByINet(entry.
                                                               serverNumber
                                                               [idx]), pname);
@@ -5403,6 +5480,8 @@ CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
                                fprintf(STDERR,
                                        "    VLDB reports its RW volume %lu exists on %s %s\n",
                                        (unsigned long)rwvolid,
+                                        noresolve ? 
+                                        afs_inet_ntoa_r(aserver, hoststr) :
                                        hostutil_GetNameByINet(aserver),
                                        pname);
                            }
@@ -5473,11 +5552,15 @@ CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
                        fprintf(STDERR,
                                "*** Warning: Orphaned BK volume %lu exists on %s %s\n",
                                (unsigned long)volumeinfo->volid,
+                                noresolve ?
+                                afs_inet_ntoa_r(aserver, hoststr) :
                                hostutil_GetNameByINet(aserver), pname);
                        MapPartIdIntoName(entry.serverPartition[idx], pname);
                        fprintf(STDERR,
                                "    VLDB reports its RW/BK volume %lu exists on %s %s\n",
                                (unsigned long)rwvolid,
+                                noresolve ?
+                                afs_inet_ntoa_r(entry.serverNumber[idx], hoststr) :
                                hostutil_GetNameByINet(entry.
                                                       serverNumber[idx]),
                                pname);
@@ -5496,6 +5579,8 @@ CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
                                fprintf(STDERR,
                                        "*** Warning: Orphaned BK volume %u exists on %s %s\n",
                                        entry.volumeId[BACKVOL],
+                                        noresolve ?
+                                        afs_inet_ntoa_r(aserver, hoststr) :
                                        hostutil_GetNameByINet(aserver),
                                        pname);
                                fprintf(STDERR,
@@ -5508,8 +5593,10 @@ CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
                                                  pname);
                                fprintf(STDERR,
                                        "*** Warning: Orphaned BK volume %lu exists on %s %s\n",
-                                       (unsigned long)volumeinfo->volid,
-                                       hostutil_GetNameByINet(aserver),
+                                        (unsigned long)volumeinfo->volid,
+                                        noresolve ?
+                                        afs_inet_ntoa_r(aserver, hoststr) :
+                                        hostutil_GetNameByINet(aserver),
                                        pname);
                                fprintf(STDERR,
                                        "    VLDB reports its BK volume ID is %u\n",
@@ -5529,7 +5616,7 @@ CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
 
            entry.serverNumber[idx] = aserver;
            entry.serverPartition[idx] = apart;
-           entry.serverFlags[idx] = ITSRWVOL;
+           entry.serverFlags[idx] = ITSBACKVOL;
 
            modified++;
        }
@@ -5579,7 +5666,9 @@ CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
                            fprintf(STDERR,
                                    "*** Warning: Orphaned RO volume %u exists on %s %s\n",
                                    entry.volumeId[ROVOL],
-                                   hostutil_GetNameByINet(entry.
+                                    noresolve ?
+                                    afs_inet_ntoa_r(entry.serverNumber[j], hoststr) :
+                                    hostutil_GetNameByINet(entry.
                                                           serverNumber[j]),
                                    pname);
                            fprintf(STDERR,
@@ -5606,8 +5695,10 @@ CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
                    MapPartIdIntoName(apart, pname);
                    fprintf(STDERR,
                            "*** Warning: Orphaned RO volume %lu exists on %s %s\n",
-                           (unsigned long)volumeinfo->volid,
-                           hostutil_GetNameByINet(aserver), pname);
+                            (unsigned long)volumeinfo->volid,
+                            noresolve ?
+                            afs_inet_ntoa_r(aserver, hoststr) :
+                            hostutil_GetNameByINet(aserver), pname);
                    fprintf(STDERR,
                            "    VLDB reports its RO volume ID is %u\n",
                            entry.volumeId[ROVOL]);
@@ -5700,7 +5791,7 @@ sortVolumes(const void *a, const void *b)
 {
     volintInfo *v1 = (volintInfo *) a;
     volintInfo *v2 = (volintInfo *) b;
-    afs_int32 rwvolid1, rwvolid2;
+    afs_uint32 rwvolid1, rwvolid2;
 
     rwvolid1 = ((v1->type == RWVOL) ? v1->volid : v1->parentID);
     rwvolid2 = ((v2->type == RWVOL) ? v2->volid : v2->parentID);
@@ -5738,28 +5829,31 @@ UV_SyncVolume(afs_int32 aserver, afs_int32 apart, char *avolname, int flags)
 {
     struct rx_connection *aconn = 0;
     afs_int32 j, k, code, vcode, error = 0;
-    afs_int32 tverbose, mod, modified = 0;
+    afs_int32 tverbose;
+    afs_int32 mod, modified = 0;
     struct nvldbentry vldbentry;
-    afs_int32 volumeid = 0;
+    afs_uint32 volumeid = 0;
     volEntries volumeInfo;
     struct partList PartList;
     afs_int32 pcnt, rv;
-    afs_int32 maxvolid = 0;
+    afs_uint32 maxvolid = 0;
 
     volumeInfo.volEntries_val = (volintInfo *) 0;
     volumeInfo.volEntries_len = 0;
 
-    if (!aserver && (flags & 1)) {
-       /* fprintf(STDERR,"Partition option requires a server option\n"); */
-       ERROR_EXIT(EINVAL);
-    }
-
     /* Turn verbose logging off and do our own verbose logging */
+    /* tverbose must be set before we call ERROR_EXIT() */
+    
     tverbose = verbose;
     if (flags & 2) 
        tverbose = 1;
     verbose = 0;
 
+    if (!aserver && (flags & 1)) {
+       /* fprintf(STDERR,"Partition option requires a server option\n"); */
+       ERROR_EXIT(EINVAL);
+    }
+
     /* Read the VLDB entry */
     vcode = VLDB_GetEntryByName(avolname, &vldbentry);
     if (vcode && (vcode != VL_NOENT)) {
@@ -5932,7 +6026,7 @@ UV_SyncVolume(afs_int32 aserver, afs_int32 apart, char *avolname, int flags)
   error_exit:
     /* Now check if the maxvolid is larger than that stored in the VLDB */
     if (maxvolid) {
-       afs_int32 maxvldbid = 0;
+       afs_uint32 maxvldbid = 0;
        code = ubik_VL_GetNewVolumeId(cstruct, 0, 0, &maxvldbid);
        if (code) {
            fprintf(STDERR,
@@ -5940,7 +6034,7 @@ UV_SyncVolume(afs_int32 aserver, afs_int32 apart, char *avolname, int flags)
            if (!error)
                error = code;
        } else if (maxvolid > maxvldbid) {
-           afs_int32 id, nid;
+           afs_uint32 id, nid;
            id = maxvolid - maxvldbid + 1;
            code = ubik_VL_GetNewVolumeId(cstruct, 0, id, &nid);
            if (code) {
@@ -5977,7 +6071,8 @@ UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
 {
     struct rx_connection *aconn;
     afs_int32 code, error = 0;
-    int i, j, pfail;
+    int i, pfail;
+    unsigned int j;
     volEntries volumeInfo;
     struct partList PartList;
     afs_int32 pcnt;
@@ -5986,6 +6081,7 @@ UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
     afs_int32 failures = 0, modifications = 0, tentries = 0;
     afs_int32 modified;
     afs_uint32 maxvolid = 0;
+    char hoststr[16];
 
     volumeInfo.volEntries_val = (volintInfo *) 0;
     volumeInfo.volEntries_len = 0;
@@ -6037,7 +6133,9 @@ UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
                fprintf(STDOUT,
                        "Processing volume entry %d: %s (%lu) on server %s %s...\n",
                        j + 1, vi->name, (unsigned long)vi->volid,
-                       hostutil_GetNameByINet(aserver), pname);
+                        noresolve ?
+                        afs_inet_ntoa_r(aserver, hoststr) :
+                        hostutil_GetNameByINet(aserver), pname);
                fflush(STDOUT);
            }
 
@@ -6066,7 +6164,9 @@ UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
        if (pfail) {
            fprintf(STDERR,
                    "Could not process entries on server %s partition %s\n",
-                   hostutil_GetNameByINet(aserver), pname);
+                    noresolve ?
+                    afs_inet_ntoa_r(aserver, hoststr) :
+                    hostutil_GetNameByINet(aserver), pname);
        }
        if (volumeInfo.volEntries_val) {
            free(volumeInfo.volEntries_val);
@@ -6086,7 +6186,7 @@ UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
   error_exit:
     /* Now check if the maxvolid is larger than that stored in the VLDB */
     if (maxvolid) {
-       afs_int32 maxvldbid = 0;
+       afs_uint32 maxvldbid = 0;
        code = ubik_VL_GetNewVolumeId(cstruct, 0, 0, &maxvldbid);
        if (code) {
            fprintf(STDERR,
@@ -6094,7 +6194,7 @@ UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
            if (!error)
                error = code;
        } else if (maxvolid > maxvldbid) {
-           afs_int32 id, nid;
+           afs_uint32 id, nid;
            id = maxvolid - maxvldbid + 1;
            code = ubik_VL_GetNewVolumeId(cstruct, 0, id, &nid);
            if (code) {
@@ -6122,7 +6222,7 @@ UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
  *      still exists - so we catch these error codes.
  */
 afs_int32
-VolumeExists(afs_int32 server, afs_int32 partition, afs_int32 volumeid)
+VolumeExists(afs_int32 server, afs_int32 partition, afs_uint32 volumeid)
 {
     struct rx_connection *conn = (struct rx_connection *)0;
     afs_int32 code = -1;
@@ -6152,6 +6252,7 @@ CheckVldbRWBK(struct nvldbentry * entry, afs_int32 * modified)
     int idx;
     afs_int32 code, error = 0;
     char pname[10];
+    char hoststr[16];
 
     if (modified)
        *modified = 0;
@@ -6186,7 +6287,9 @@ CheckVldbRWBK(struct nvldbentry * entry, afs_int32 * modified)
                fprintf(STDERR,
                        "Transaction call failed for RW volume %u on server %s %s\n",
                        entry->volumeId[RWVOL],
-                       hostutil_GetNameByINet(entry->serverNumber[idx]),
+                        noresolve ?
+                        afs_inet_ntoa_r(entry->serverNumber[idx], hoststr) :
+                        hostutil_GetNameByINet(entry->serverNumber[idx]),
                        pname);
                ERROR_EXIT(code);
            }
@@ -6223,7 +6326,9 @@ CheckVldbRWBK(struct nvldbentry * entry, afs_int32 * modified)
                fprintf(STDERR,
                        "Transaction call failed for BK volume %u on server %s %s\n",
                        entry->volumeId[BACKVOL],
-                       hostutil_GetNameByINet(entry->serverNumber[idx]),
+                        noresolve ?
+                        afs_inet_ntoa_r(entry->serverNumber[idx], hoststr) :
+                        hostutil_GetNameByINet(entry->serverNumber[idx]),
                        pname);
                ERROR_EXIT(code);
            }
@@ -6254,6 +6359,7 @@ CheckVldbRO(struct nvldbentry *entry, afs_int32 * modified)
     int foundro = 0, modentry = 0;
     afs_int32 code, error = 0;
     char pname[10];
+    char hoststr[16];
 
     if (modified)
        *modified = 0;
@@ -6282,7 +6388,9 @@ CheckVldbRO(struct nvldbentry *entry, afs_int32 * modified)
            fprintf(STDERR,
                    "Transaction call failed for RO %u on server %s %s\n",
                    entry->volumeId[ROVOL],
-                   hostutil_GetNameByINet(entry->serverNumber[idx]), pname);
+                    noresolve ?
+                    afs_inet_ntoa_r(entry->serverNumber[idx], hoststr) :
+                    hostutil_GetNameByINet(entry->serverNumber[idx]), pname);
            ERROR_EXIT(code);
        }
     }
@@ -6566,6 +6674,7 @@ UV_RenameVolume(struct nvldbentry *entry, char oldname[], char newname[])
     afs_int32 tid;
     struct rx_connection *aconn;
     int islocked;
+    char hoststr[16];
 
     error = 0;
     aconn = (struct rx_connection *)0;
@@ -6605,7 +6714,7 @@ UV_RenameVolume(struct nvldbentry *entry, char oldname[], char newname[])
        }
        aconn = UV_Bind(entry->serverNumber[index], AFSCONF_VOLUMEPORT);
        code =
-           AFSVolTransCreate(aconn, entry->volumeId[RWVOL],
+           AFSVolTransCreate_retry(aconn, entry->volumeId[RWVOL],
                              entry->serverPartition[index], ITOffline, &tid);
        if (code) {             /*volume doesnot exist */
            fprintf(STDERR,
@@ -6655,7 +6764,7 @@ UV_RenameVolume(struct nvldbentry *entry, char oldname[], char newname[])
        }
        aconn = UV_Bind(entry->serverNumber[index], AFSCONF_VOLUMEPORT);
        code =
-           AFSVolTransCreate(aconn, entry->volumeId[BACKVOL],
+           AFSVolTransCreate_retry(aconn, entry->volumeId[BACKVOL],
                              entry->serverPartition[index], ITOffline, &tid);
        if (code) {             /*volume doesnot exist */
            fprintf(STDERR,
@@ -6705,7 +6814,7 @@ UV_RenameVolume(struct nvldbentry *entry, char oldname[], char newname[])
            if (entry->serverFlags[i] & ITSROVOL) {
                aconn = UV_Bind(entry->serverNumber[i], AFSCONF_VOLUMEPORT);
                code =
-                   AFSVolTransCreate(aconn, entry->volumeId[ROVOL],
+                   AFSVolTransCreate_retry(aconn, entry->volumeId[ROVOL],
                                      entry->serverPartition[i], ITOffline,
                                      &tid);
                if (code) {     /*volume doesnot exist */
@@ -6730,7 +6839,9 @@ UV_RenameVolume(struct nvldbentry *entry, char oldname[], char newname[])
                    if (!code) {
                        VPRINT2("Renamed RO volume %s on host %s\n",
                                nameBuffer,
-                               hostutil_GetNameByINet(entry->
+                                noresolve ?
+                                afs_inet_ntoa_r(entry->serverNumber[i], hoststr) :
+                                hostutil_GetNameByINet(entry->
                                                       serverNumber[i]));
                        code = AFSVolEndTrans(aconn, tid, &rcode);
                        tid = 0;
@@ -6820,7 +6931,7 @@ UV_VolserStatus(afs_int32 server, transDebugInfo ** rpntr, afs_int32 * rcount)
 
 /*delete the volume without interacting with the vldb */
 int
-UV_VolumeZap(afs_int32 server, afs_int32 part, afs_int32 volid)
+UV_VolumeZap(afs_int32 server, afs_int32 part, afs_uint32 volid)
 {
     afs_int32 rcode, ttid, error, code;
     struct rx_connection *aconn;
@@ -6830,7 +6941,7 @@ UV_VolumeZap(afs_int32 server, afs_int32 part, afs_int32 volid)
     ttid = 0;
 
     aconn = UV_Bind(server, AFSCONF_VOLUMEPORT);
-    code = AFSVolTransCreate(aconn, volid, part, ITOffline, &ttid);
+    code = AFSVolTransCreate_retry(aconn, volid, part, ITOffline, &ttid);
     if (code) {
        fprintf(STDERR, "Could not start transaction on volume %lu\n",
                (unsigned long)volid);
@@ -6869,7 +6980,7 @@ UV_VolumeZap(afs_int32 server, afs_int32 part, afs_int32 volid)
 }
 
 int
-UV_SetVolume(afs_int32 server, afs_int32 partition, afs_int32 volid,
+UV_SetVolume(afs_int32 server, afs_int32 partition, afs_uint32 volid,
             afs_int32 transflag, afs_int32 setflag, int sleeptime)
 {
     struct rx_connection *conn = 0;
@@ -6882,7 +6993,7 @@ UV_SetVolume(afs_int32 server, afs_int32 partition, afs_int32 volid,
        ERROR_EXIT(-1);
     }
 
-    code = AFSVolTransCreate(conn, volid, partition, transflag, &tid);
+    code = AFSVolTransCreate_retry(conn, volid, partition, transflag, &tid);
     if (code) {
        fprintf(STDERR, "SetVolumeStatus: TransCreate Failed\n");
        ERROR_EXIT(code);
@@ -6919,7 +7030,7 @@ UV_SetVolume(afs_int32 server, afs_int32 partition, afs_int32 volid,
 }
 
 int
-UV_SetVolumeInfo(afs_int32 server, afs_int32 partition, afs_int32 volid,
+UV_SetVolumeInfo(afs_int32 server, afs_int32 partition, afs_uint32 volid,
                 volintInfo * infop)
 {
     struct rx_connection *conn = 0;
@@ -6932,7 +7043,7 @@ UV_SetVolumeInfo(afs_int32 server, afs_int32 partition, afs_int32 volid,
        ERROR_EXIT(-1);
     }
 
-    code = AFSVolTransCreate(conn, volid, partition, ITOffline, &tid);
+    code = AFSVolTransCreate_retry(conn, volid, partition, ITOffline, &tid);
     if (code) {
        fprintf(STDERR, "SetVolumeInfo: TransCreate Failed\n");
        ERROR_EXIT(code);
@@ -6961,7 +7072,7 @@ UV_SetVolumeInfo(afs_int32 server, afs_int32 partition, afs_int32 volid,
 }
 
 int
-UV_GetSize(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_GetSize(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
           afs_int32 fromdate, struct volintSize *vol_size)
 {
     struct rx_connection *aconn = (struct rx_connection *)0;
@@ -6973,7 +7084,7 @@ UV_GetSize(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     aconn = UV_Bind(afromserver, AFSCONF_VOLUMEPORT);
 
     VPRINT1("Starting transaction on volume %u...", afromvol);
-    code = AFSVolTransCreate(aconn, afromvol, afrompart, ITBusy, &tid);
+    code = AFSVolTransCreate_retry(aconn, afromvol, afrompart, ITBusy, &tid);
     EGOTO1(error_exit, code,
           "Could not start transaction on the volume %u to be measured\n",
           afromvol);