]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-volser-cleanup-xx-20061128
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 28 Nov 2006 09:34:20 +0000 (09:34 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 28 Nov 2006 09:34:20 +0000 (09:34 +0000)
cleanup the return code handling from

  volser-dump-validate-input-20060417

(cherry picked from commit 1c661a198efca3b3273b1c523b19a367ddbee4d7)

src/volser/dumpstuff.c
src/volser/volprocs.c

index c08accabf2f8af73bc883116daab24250b0997b8..ec9933e568735318c3a426fd9268938c549cc56f 100644 (file)
@@ -990,7 +990,7 @@ ProcessIndex(Volume * vp, VnodeClass class, afs_int32 ** Bufp, int *sizep,
            if (Buf == NULL) {
                STREAM_CLOSE(afile);
                FDH_CLOSE(fdP);
-               return 1;
+               return -1;
            }
            memset((char *)Buf, 0, nVnodes * sizeof(afs_int32));
            STREAM_SEEK(afile, offset = vcp->diskSize, 0);
@@ -1048,13 +1048,10 @@ RestoreVolume(register struct rx_call *call, Volume * avp, int incremental,
        delo = ProcessIndex(vp, vLarge, &b1, &s1, 0);
     if (!delo)
        delo = ProcessIndex(vp, vSmall, &b2, &s2, 0);
-    if (delo) {
-       if (b1)
-           free((char *)b1);
-       if (b2)
-           free((char *)b2);
-       b1 = b2 = NULL;
-       s1 = s2 = 0;
+    if (delo < 0) {
+       Log("1 Volser: RestoreVolume: ProcessIndex failed; not restored\n");
+       error = VOLSERREAD_DUMPERROR;
+       goto out;
     }
 
     strncpy(vol.name, cookie->name, VOLSER_OLDMAXVOLNAME);
@@ -1062,7 +1059,6 @@ RestoreVolume(register struct rx_call *call, Volume * avp, int incremental,
     vol.cloneId = cookie->clone;
     vol.parentId = cookie->parent;
 
-
     tdelo = delo;
     while (1) {
        if (ReadVnodes(iodp, vp, 0, b1, s1, b2, s2, tdelo)) {
@@ -1095,8 +1091,8 @@ RestoreVolume(register struct rx_call *call, Volume * avp, int incremental,
     if (!delo) {
        delo = ProcessIndex(vp, vLarge, &b1, &s1, 1);
        if (!delo)
-           ProcessIndex(vp, vSmall, &b2, &s2, 1);
-       if (delo) {
+           delo = ProcessIndex(vp, vSmall, &b2, &s2, 1);
+       if (delo < 0) {
            error = VOLSERREAD_DUMPERROR;
            goto clean;
        }
index 9319b4817ad14c26e702ed1917dd8a501fdcb6c1..43d7399910a3904e36fcc46e70a0bf054082d15b 100644 (file)
@@ -1196,8 +1196,8 @@ SAFSVolForwardMultiple(struct rx_call *acid, afs_int32 fromTrans, afs_int32
     vp = tt->volume;
     strcpy(tt->lastProcName, "ForwardMulti");
 
-    /* (fromDate == 0) ==> incremental dump */
-    is_incremental = (fromDate ? 1 : 0);
+    /* (fromDate == 0) ==> full dump */
+    is_incremental = ((V_parentId(vp) == V_id(vp) && fromDate) ? 1 : 0);
 
     i = results->manyResults_len = destinations->manyDests_len;
     results->manyResults_val = codes =