]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
FSSYNC-Client: Consistent use of partition name
authorRod Widdowson <rdw@steadingsoftware.com>
Thu, 29 Sep 2011 14:34:48 +0000 (15:34 +0100)
committerDerrick Brashear <shadow@dementix.org>
Sun, 9 Oct 2011 17:21:55 +0000 (10:21 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit b4f96eb78d9403799b97a39b9659070cf1114cd1)

Change-Id: I84d3dd586c735e9a6e2f598317873ba554a10ece
Reviewed-on: http://gerrit.openafs.org/5547
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/vol/fssync.h
src/vol/vol-salvage.c
src/vol/volume.c

index 9a1cd2e1875d0cc8317cf0610bc3fb947b7724cb..e9bdf8b6b2e661a7cd636858add5438b84d9c7fd 100644 (file)
@@ -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);
 
index 13ed71bb876a6349177b29f1c53d454182b239ce..560de8ccc92ad430b2661f46ba1dab6fd3288c10 100644 (file)
@@ -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;
index bd347a936c791e538e7e32caecbc27e115c2bfd9..a308bd56db8aebc6179a87cbecfe94b02cf4c75c 100644 (file)
@@ -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;