From f1938e51a35586c56a66749e096e30dcbffda033 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 28 Nov 2006 09:29:28 +0000 Subject: [PATCH] DEVEL15-volser-cleanup-20061128 cleanup the return code handling from DELTA volser-dump-validate-input-20060417 --- src/volser/dumpstuff.c | 18 +++++++----------- src/volser/volprocs.c | 4 ++-- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index 79d460b07..cd8f252d7 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -998,7 +998,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); @@ -1056,13 +1056,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); @@ -1070,7 +1067,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; @@ -1109,8 +1105,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; } diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 5bba7c10f..64eb2b3b2 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -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 = -- 2.39.5