use V_copyDate in DumpHeader for cloned volumes
[openafs.git] / src / volser / dumpstuff.c
index 0323922..bc1fe9f 100644 (file)
@@ -1037,7 +1037,19 @@ DumpDumpHeader(struct iod *iodp, Volume * vp,
     if (!code)
        code = DumpString(iodp, 'n', V_name(vp));
     dumpTimes[0] = fromtime;
-    dumpTimes[1] = V_backupDate(vp);   /* Until the time the clone was made */
+    switch (V_type(vp)) {
+    case readwriteVolume:
+       dumpTimes[1] = V_updateDate(vp);        /* until last update */
+       break;
+    case readonlyVolume:
+       dumpTimes[1] = V_copyDate(vp);          /* until clone was made */
+       break;
+    case backupVolume:
+       dumpTimes[1] = V_backupDate(vp);        /* until backup was made */
+       break;
+    default:
+       code = EINVAL;
+    }
     if (!code)
        code = DumpArrayInt32(iodp, 't', (afs_uint32 *) dumpTimes, 2);
     return code;