From b4f96eb78d9403799b97a39b9659070cf1114cd1 Mon Sep 17 00:00:00 2001 From: Rod Widdowson Date: Thu, 29 Sep 2011 15:34:48 +0100 Subject: [PATCH] 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. Change-Id: I3c5b63103ab0cbd6c2c6c73b9dc737eca22b7d4c Reviewed-on: http://gerrit.openafs.org/5521 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/vol/fssync.h | 6 +++++- src/vol/vol-salvage.c | 2 +- src/vol/volume.c | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/vol/fssync.h b/src/vol/fssync.h index 9a1cd2e..e9bdf8b 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 c770ce1..b8c3f3e 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -4319,7 +4319,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 bca4bd3..f5b2f98 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -2781,7 +2781,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) { @@ -2917,7 +2917,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 @@ -5765,7 +5765,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; -- 1.9.4