From: Andrew Deason Date: Wed, 29 Sep 2010 16:48:44 +0000 (-0500) Subject: salvager: Do not break cbks when salvaging parts X-Git-Tag: debian/1.6.0.pre3-1~5^2^2~24 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=80159e9312ed2249866159170cea568a2108250d;p=packages%2Fo%2Fopenafs.git salvager: Do not break cbks when salvaging parts When salvaging whole partitions / whole servers, the fileserver is assumed to not be running. So only break callbacks if we are salvaging a single volume. If we are salvaging a whole partition, do not tell the fileserver to break callbacks on changed volumes, since the fileserver will not be around and we will just hang. Reviewed-on: http://gerrit.openafs.org/2865 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit fabd590cc4b0142fe97c4ffa6a4669fe5d44c359) Change-Id: I62eaa14c95ecce3dcd5fdde97f3a45f9103fc7bc Reviewed-on: http://gerrit.openafs.org/4175 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index faa4ca82d..824af59d1 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -306,6 +306,8 @@ struct SalvInfo { * vnodes in the volume that * we are currently looking * at */ + int useFSYNC; /**< 0 if the fileserver is unavailable; 1 if we should try + * to contact the fileserver over FSYNC */ }; char *tmpdir = NULL; @@ -786,6 +788,7 @@ SalvageFileSys1(struct DiskPartition64 *partP, VolumeId singleVolumeNumber) Abort("Couldn't connect to file server\n"); } + salvinfo->useFSYNC = 1; AskOffline(salvinfo, singleVolumeNumber); #ifdef AFS_DEMAND_ATTACH_FS if (LockVolume(salvinfo, singleVolumeNumber)) { @@ -794,6 +797,7 @@ SalvageFileSys1(struct DiskPartition64 *partP, VolumeId singleVolumeNumber) #endif /* AFS_DEMAND_ATTACH_FS */ } else { + salvinfo->useFSYNC = 0; VLockPartition(partP->name); if (ForceSalvage) { ForceSalvage = 1; @@ -4101,7 +4105,7 @@ SalvageVolume(struct SalvInfo *salvinfo, struct InodeSummary *rwIsp, IHandle_t * } #ifdef FSSYNC_BUILD_CLIENT - if (!Testing && salvinfo->VolumeChanged) { + if (!Testing && salvinfo->VolumeChanged && salvinfo->useFSYNC) { afs_int32 fsync_code; fsync_code = FSYNC_VolOp(vid, NULL, FSYNC_VOL_BREAKCBKS, FSYNC_SALVAGE, NULL);