X-Git-Url: http://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fvol%2Fvol-salvage.c;h=b1838d859c22e2bd16ab3c2fb619ad762ce9cc34;hp=5ce3147da02f71d36120b41b4a64dc4cacb27915;hb=f2c1f2ee48663d00701e7cee52b99151e36b9534;hpb=22149d82d465f5defbe329b3f9b3c5040a6293e9 diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 5ce3147..b1838d8 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -936,9 +936,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++) { @@ -4432,10 +4434,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; @@ -4458,6 +4462,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");