From: Jeffrey Altman Date: Sat, 24 Mar 2018 05:22:54 +0000 (-0400) Subject: volser: DoVolDelete returning VNOVOL is success X-Git-Tag: openafs-devel-1_9_0~517 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=328590dc5669cae3db6c509871b612b0384ea33d volser: DoVolDelete returning VNOVOL is success When moving, copying or releasing volumes, do not treat a failure to delete a volume because the volume no longer exists as an error. The volume clone has flags VTDeleteOnSalvage | VTOutOfService assigned to it which means that the fileserver won't attach the volume and volume has its deleteMe field assigned the value of DESTROY_ME. Such a volume will be deleted the next time the salvager scans the partition. Once the transaction is complete the volume might be removed. Change-Id: I0bd38906e3836e0c96f3784a8bd9ad63f5b857c6 Reviewed-on: https://gerrit.openafs.org/12976 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index b8bc0a8..87506f8 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -2033,13 +2033,12 @@ UV_MoveVolume2(afs_uint32 afromvol, afs_uint32 afromserver, afs_int32 afrompart, if (!(flags & RV_NOCLONE)) { code = DoVolDelete(fromconn, newVol, afrompart, "cloned", 0, NULL, NULL); - if (code) { - if (code == VNOVOL) { - EPRINT1(code, "Failed to start transaction on %u\n", newVol); - } + if (code && code != VNOVOL) { error = code; goto mfail; } + + code = 0; /* clone missing? that's okay */ } /* fall through */ @@ -2645,13 +2644,12 @@ cpincr: if (!(flags & RV_NOCLONE)) { code = DoVolDelete(fromconn, cloneVol, afrompart, "cloned", 0, NULL, NULL); - if (code) { - if (code == VNOVOL) { - EPRINT1(code, "Failed to start transaction on %u\n", cloneVol); - } + if (code && code != VNOVOL) { error = code; goto mfail; } + + code = 0; /* clone missing? that's ok */ } if (!(flags & RV_NOVLDB)) { @@ -2775,11 +2773,8 @@ cpincr: /* common cleanup - delete local clone */ if (cloneVol) { - code = DoVolDelete(fromconn, cloneVol, afrompart, - "clone", 0, NULL, "Recovery:"); - if (code == VNOVOL) { - EPRINT1(code, "Recovery: Failed to start transaction on %u\n", cloneVol); - } + DoVolDelete(fromconn, cloneVol, afrompart, "clone", 0, NULL, + "Recovery:"); } done: /* routine cleanup */ @@ -4219,7 +4214,8 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver, } code = DoVolDelete(fromconn, cloneVolId, afrompart, NULL, 0, NULL, NULL); - ONERROR(code, cloneVolId, "Failed to delete volume %u.\n"); + if (code && code != VNOVOL) + ONERROR(code, cloneVolId, "Failed to delete volume %u.\n"); VDONE; }