From: Rod Widdowson Date: Thu, 29 Sep 2011 14:34:48 +0000 (+0100) Subject: FSSYNC-Client: Consistent use of partition name X-Git-Tag: upstream/1.6.1.pre1^2~194 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=45fb811afc05f6d9ab780b984b647db6c1341241;p=packages%2Fo%2Fopenafs.git FSSYNC-Client: Consistent use of partition name Over time the FSSYNC code has collected examples where the partition path is passed rather than the partition name. In Unix this is the same (/vicepX), but on windows the path is the DOS device (C:). This checkin changes FSSYNC client code to always use the partition name. This checkin does not address FSSYNC server or SALVSYNC. Reviewed-on: http://gerrit.openafs.org/5521 Tested-by: BuildBot Reviewed-by: Jeffrey Altman (cherry picked from commit b4f96eb78d9403799b97a39b9659070cf1114cd1) Change-Id: I84d3dd586c735e9a6e2f598317873ba554a10ece Reviewed-on: http://gerrit.openafs.org/5547 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/vol/fssync.h b/src/vol/fssync.h index 9a1cd2e18..e9bdf8b6b 100644 --- a/src/vol/fssync.h +++ b/src/vol/fssync.h @@ -207,7 +207,11 @@ extern afs_int32 FSYNC_GenericOp(void * ext_hdr, size_t ext_len, int command, int reason, SYNC_response * res); -/* volume operations control interface */ +/* + * volume operations control interface + * + * FSYNC_VolOp must be called with the partition name and not the partition path. + */ extern afs_int32 FSYNC_VolOp(VolumeId volume, char *partName, int com, int reason, SYNC_response * res); diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 13ed71bb8..560de8ccc 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -4311,7 +4311,7 @@ LockVolume(struct SalvInfo *salvinfo, VolumeId volumeId) afs_printable_uint32_lu(volumeId)); } - code = FSYNC_VerifyCheckout(volumeId, salvinfo->fileSysPathName, FSYNC_VOL_OFF, FSYNC_SALVAGE); + code = FSYNC_VerifyCheckout(volumeId, salvinfo->fileSysPartition->name, FSYNC_VOL_OFF, FSYNC_SALVAGE); if (code == SYNC_DENIED) { /* need to retry checking out volumes */ return -1; diff --git a/src/vol/volume.c b/src/vol/volume.c index bd347a936..a308bd56d 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -2779,7 +2779,7 @@ attach_volume_header(Error *ec, Volume *vp, struct DiskPartition64 *partp, SYNC_response res; memset(&res, 0, sizeof(res)); - if (FSYNC_VolOp(volid, VPartitionPath(partp), FSYNC_VOL_NEEDVOLUME, mode, &res) + if (FSYNC_VolOp(volid, partp->name, FSYNC_VOL_NEEDVOLUME, mode, &res) != SYNC_OK) { if (res.hdr.reason == FSYNC_SALVAGE) { @@ -2915,7 +2915,7 @@ attach_volume_header(Error *ec, Volume *vp, struct DiskPartition64 *partp, #if defined(AFS_DEMAND_ATTACH_FS) && defined(FSSYNC_BUILD_CLIENT) if (!peek && *ec == 0 && retry == 0 && VMustCheckoutVolume(mode)) { - code = FSYNC_VerifyCheckout(volid, VPartitionPath(partp), FSYNC_VOL_NEEDVOLUME, mode); + code = FSYNC_VerifyCheckout(volid, partp->name, FSYNC_VOL_NEEDVOLUME, mode); if (code == SYNC_DENIED) { /* must retry checkout; fileserver no longer thinks we have @@ -5312,7 +5312,7 @@ VScheduleSalvage_r(Volume * vp) * set the volume to an exclusive state and drop the lock * around the SALVSYNC call */ - strlcpy(partName, VPartitionPath(vp->partition), sizeof(partName)); + strlcpy(partName, vp->partition->name, sizeof(partName)); state_save = VChangeState_r(vp, VOL_STATE_SALVSYNC_REQ); VOL_UNLOCK;