From 1c661a198efca3b3273b1c523b19a367ddbee4d7 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 28 Nov 2006 09:30:58 +0000 Subject: [PATCH] volser-cleanup-xx-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 adfc7698f..59865ee50 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -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; } 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