volser: Do not reset copyDate in ReClone
authorAndrew Deason <adeason@sinenomine.net>
Thu, 3 Feb 2011 22:11:38 +0000 (16:11 -0600)
committerDerrick Brashear <shadow@dementix.org>
Wed, 14 Dec 2011 17:10:16 +0000 (09:10 -0800)
When we ReClone in the volserver, do not reset the clone's copyDate to
the current time. If we retain the copyDate between ReClone
operations, then we can know when the clone was first created (and
thus makes local RO clones more consistent with remote RO sites).

Change-Id: Ic76862c1a03ee3cafaf199f414fabc90e3b058d2
Reviewed-on: http://gerrit.openafs.org/3892
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/volser/volprocs.c

index 05c7006..a906b5f 100644 (file)
@@ -970,15 +970,16 @@ VolReClone(struct rx_call *acid, afs_int32 atrans, afs_int32 cloneId)
     }
     /* don't do strcpy onto diskstuff.name, it's still OK from 1st clone */
 
-    /* pretend recloned volume is a totally new instance */
-    V_copyDate(clonevp) = time(0);
-    V_creationDate(clonevp) = V_copyDate(clonevp);
+    /* update the creationDate, since this represents the last cloning date
+     * for ROs. But do not update copyDate; let it stay so we can identify
+     * when the clone was first created. */
+    V_creationDate(clonevp) = time(0);
     ClearVolumeStats(&V_disk(clonevp));
     V_destroyMe(clonevp) = 0;
     V_inService(clonevp) = 0;
     if (newType == backupVolume) {
-       V_backupDate(originalvp) = V_copyDate(clonevp);
-       V_backupDate(clonevp) = V_copyDate(clonevp);
+       V_backupDate(originalvp) = V_creationDate(clonevp);
+       V_backupDate(clonevp) = V_creationDate(clonevp);
     }
     V_inUse(clonevp) = 0;
     VUpdateVolume(&error, clonevp);