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

  DELTA volser-dump-validate-input-20060417

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

index adfc7698fcd81e036f4d512f18d7e5bbb3db49a9..59865ee5038b8ade6e741cb51b55171801eea08b 100644 (file)
@@ -997,7 +997,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);
@@ -1055,13 +1055,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);
@@ -1069,7 +1066,6 @@ RestoreVolume(register struct rx_call *call, Volume * avp, int incremental,
     vol.cloneId = cookie->clone;
     vol.parentId = cookie->parent;
 
-
     tdelo = delo;
     while (1) {
        int temprc;
@@ -1108,8 +1104,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 5bba7c10f502bb18a973a2044daebb73bb07f763..64eb2b3b20da92b0cd4656f6f678e8eb8a57a1d7 100644 (file)
@@ -1197,8 +1197,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 =