code =
AFSVolTransCreate_retry(aconn, avolid, apart, ITOffline, &ttid);
+ /* return early and quietly for VNOVOL; don't continue the attempt to delete. */
+ if (code == VNOVOL) {
+ error = code;
+ goto dfail;
+ }
+
EGOTO2(dfail, code, "%sFailed to start transaction on %u\n",
prefix, avolid);
pntg = 1;
toconn = UV_Bind(atoserver, AFSCONF_VOLUMEPORT); /* get connections to the servers */
fromconn = UV_Bind(afromserver, AFSCONF_VOLUMEPORT);
- fromtid = totid = 0; /* initialize to uncreated */
+ totid = 0; /* initialize to uncreated */
/* ***
* clone the read/write volume locally.
code = DoVolDelete(fromconn, newVol, afrompart,
"cloned", 0, NULL, NULL);
if (code) {
+ if (code == VNOVOL) {
+ EPRINT1(code, "Failed to start transaction on %u\n", newVol);
+ }
error = code;
goto mfail;
}
fflush(STDOUT);
}
- if (volid && toconn)
- DoVolDelete(toconn, volid, atopart,
- "destination", 0, NULL, "Recovery:");
+ if (volid && toconn) {
+ code = DoVolDelete(toconn, volid, atopart,
+ "destination", 0, NULL, "Recovery:");
+ if (code == VNOVOL) {
+ EPRINT1(code, "Recovery: Failed to start transaction on %u\n", volid);
+ }
+ }
/* put source volume on-line */
if (fromconn) {
/* delete backup volume */
if (fromconn) {
- DoVolDelete(fromconn, backupId, afrompart,
- "backup", 0, NULL, "Recovery:");
+ code = DoVolDelete(fromconn, backupId, afrompart,
+ "backup", 0, NULL, "Recovery:");
+ if (code == VNOVOL) {
+ EPRINT1(code, "Recovery: Failed to start transaction on %u\n", backupId);
+ }
- DoVolDelete(fromconn, afromvol, afrompart, "source",
- (atoserver != afromserver)?atoserver:0,
+ code = DoVolDelete(fromconn, afromvol, afrompart, "source",
+ (atoserver != afromserver)?atoserver:0,
NULL, NULL);
+ if (code == VNOVOL) {
+ EPRINT1(code, "Failed to start transaction on %u\n", afromvol);
+ }
}
}
/* common cleanup - delete local clone */
- if (newVol)
- DoVolDelete(fromconn, newVol, afrompart,
- "clone", 0, NULL, "Recovery:");
+ if (newVol) {
+ code = DoVolDelete(fromconn, newVol, afrompart,
+ "clone", 0, NULL, "Recovery:");
+ if (code == VNOVOL) {
+ EPRINT1(code, "Recovery: Failed to start transaction on %u\n", newVol);
+ }
+ }
/* unlock VLDB entry */
if (islocked) {
ubik_VL_ReleaseLock(cstruct, 0, afromvol, -1,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
VDONE;
- islocked = 0;
}
done: /* routine cleanup */
if (volName)
code = DoVolDelete(fromconn, cloneVol, afrompart,
"cloned", 0, NULL, NULL);
if (code) {
+ if (code == VNOVOL) {
+ EPRINT1(code, "Failed to start transaction on %u\n", cloneVol);
+ }
error = code;
goto mfail;
}
MapHostToNetwork(&entry);
/* common cleanup - delete local clone */
- if (cloneVol)
+ if (cloneVol) {
code = DoVolDelete(fromconn, cloneVol, afrompart,
- "clone", 0, NULL, "Recovery:");
+ "clone", 0, NULL, "Recovery:");
+ if (code == VNOVOL) {
+ EPRINT1(code, "Recovery: Failed to start transaction on %u\n", cloneVol);
+ }
+ }
done: /* routine cleanup */
if (fromconn)
/* If the volume does not exist, create it */
if (!volid || code) {
- char volname[64];
+ char volname[VL_MAXNAMELEN];
char hoststr[16];
if (volid && (code != VNOVOL)) {
goto fail;
}
- strcpy(volname, vldbEntryPtr->name);
+ strlcpy(volname, vldbEntryPtr->name, sizeof(volname));
+
+ if (strlcat(volname,
+ tmpVolId?".roclone":".readonly",
+ sizeof(volname)) >= sizeof(volname)) {
+ code = ENOMEM;
+ PrintError("Volume name is too long\n", code);
+ goto fail;
+ }
+
if (tmpVolId)
strcat(volname, ".roclone");
else
char tovolreal[VOLSER_OLDMAXVOLNAME];
afs_uint32 pvolid;
afs_int32 temptid, pparentid;
- int success;
struct nvldbentry entry, storeEntry;
afs_int32 error;
int islocked;
memset(&cookie, 0, sizeof(cookie));
islocked = 0;
- success = 0;
error = 0;
reuseID = 1;
tocall = (struct rx_call *)0;
goto refail;
}
- success = 1;
fprintf(STDOUT, " done\n");
fflush(STDOUT);
- if (success && (!reuseID || (flags & RV_FULLRST))) {
+ if (!reuseID || (flags & RV_FULLRST)) {
/* Volume was restored on the file server, update the
* VLDB to reflect the change.
*/
* We set the val field to a null pointer as a hint for the stub to
* allocate space.
*/
- code = 0;
*a_numEntsInResultP = 0;
*a_resultPP = (volintXInfo *) 0;
volumeXInfo.volXEntries_val = (volintXInfo *) 0;
afs_int32 code = 0;
volEntries volumeInfo;
- code = 0;
-
*resultPtr = (volintInfo *) 0;
volumeInfo.volEntries_val = (volintInfo *) 0; /*this hints the stub to allocate space */
volumeInfo.volEntries_len = 0;
* the info. Setting the val field to a null pointer tells the stub
* to allocate space for us.
*/
- code = 0;
*a_resultPP = (volintXInfo *) 0;
volumeXInfo.volXEntries_val = (volintXInfo *) 0;
volumeXInfo.volXEntries_len = 0;
aconn = UV_Bind(server, AFSCONF_VOLUMEPORT);
error = DoVolDelete(aconn, volid, part,
"the", 0, NULL, NULL);
+ if (error == VNOVOL) {
+ EPRINT1(error, "Failed to start transaction on %u\n", volid);
+ }
PrintError("", error);
if (aconn)