]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
volser: DoVolDelete returning VNOVOL is success
authorJeffrey Altman <jaltman@auristor.com>
Sat, 24 Mar 2018 05:22:54 +0000 (01:22 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 21 Dec 2018 13:20:41 +0000 (08:20 -0500)
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.

Reviewed-on: https://gerrit.openafs.org/12976
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 328590dc5669cae3db6c509871b612b0384ea33d)

Change-Id: Iea98049a3948b75a5e7c13c068add663c9276515
Reviewed-on: https://gerrit.openafs.org/13235
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/volser/vsprocs.c

index b8bc0a84a72d4f4d6307d3021aa3733b3eccaa8e..87506f8b430ca956ea52af18223b84dfc9b30c45 100644 (file)
@@ -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;
     }