]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
salvager: Do not AskOnline nonexistent volumes
authorAndrew Deason <adeason@sinenomine.net>
Wed, 23 Mar 2011 21:12:20 +0000 (16:12 -0500)
committerDerrick Brashear <shadow@dementix.org>
Wed, 2 Nov 2011 02:33:29 +0000 (19:33 -0700)
If singleVolumeNumber is not in our volume summary list, then the
singleVolumeNumber volume does not exist. So, don't try to bring it
back online. Still do try to make sure we don't have the volume
checked out, though, so issue an AskDelete, so ensure that it's not
checked out and that the fileserver does not think it exists.

Change AskDelete so we don't care if we tried to delete a volume that
the fileserver thinks already doesn't exist. Change the FSYNC_VOL_DONE
handler so it does not complain about already-deleted volumes.

Reviewed-on: http://gerrit.openafs.org/4295
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f2c1f2ee48663d00701e7cee52b99151e36b9534)

Change-Id: I708c173ae6cbd3f40cc09f6fc3229a6f038baf3f
Reviewed-on: http://gerrit.openafs.org/5760
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
src/vol/fssync-server.c
src/vol/vol-salvage.c

index caa1efc25a3e635af12622c302e92cf0afcb254e..ec95f329aa4aed6c2d5d2801c50af701b9765d08 100644 (file)
@@ -1264,6 +1264,10 @@ FSYNC_com_VolDone(FSSYNC_VolOp_command * vcom, SYNC_response * res)
                 * possibly by putting the vp back on the VLRU. */
 
                code = SYNC_OK;
+           } else if (V_attachState(vp) == VOL_STATE_DELETED) {
+               VDeregisterVolOp_r(vp);
+               res->hdr.reason = FSYNC_UNKNOWN_VOLID;
+
            } else {
                code = SYNC_DENIED;
                res->hdr.reason = FSYNC_BAD_STATE;
index fb95a39ddc74705309e5f338f538b6dff0d8cbb3..31ab2374a762d2117c477909d6f987180edc9466 100644 (file)
@@ -956,9 +956,11 @@ SalvageFileSys1(struct DiskPartition64 *partP, VolumeId singleVolumeNumber)
        }
 
        if (!foundSVN) {
-           /* singleVolumeNumber generally should always be in the constructed
-            * volumeSummary, but just in case it's not... */
-           AskOnline(salvinfo, singleVolumeNumber);
+           /* If singleVolumeNumber is not in our volumeSummary, it means that
+            * at least one other volume in the VG is on the partition, but the
+            * RW volume is not. We've already AskOffline'd it by now, though,
+            * so make sure we don't still have the volume checked out. */
+           AskDelete(salvinfo, singleVolumeNumber);
        }
 
        for (j = 0; j < salvinfo->nVolumes; j++) {
@@ -4490,10 +4492,12 @@ void
 AskDelete(struct SalvInfo *salvinfo, VolumeId volumeId)
 {
     afs_int32 code, i;
+    SYNC_response res;
 
     for (i = 0; i < 3; i++) {
+       memset(&res, 0, sizeof(res));
        code = FSYNC_VolOp(volumeId, salvinfo->fileSysPartition->name,
-                          FSYNC_VOL_DONE, FSYNC_SALVAGE, NULL);
+                          FSYNC_VOL_DONE, FSYNC_SALVAGE, &res);
 
        if (code == SYNC_OK) {
            break;
@@ -4516,6 +4520,11 @@ AskDelete(struct SalvInfo *salvinfo, VolumeId volumeId)
 #endif
            }
            break;
+       } else if (code == SYNC_FAILED &&
+                    (res.hdr.reason == FSYNC_UNKNOWN_VOLID ||
+                     res.hdr.reason == FSYNC_WRONG_PART)) {
+           /* volume is already effectively 'deleted' */
+           break;
        } else if (i < 2) {
            /* try it again */
            Log("AskOnline:  request for fileserver to delete volume failed; trying again...\n");