vd.uniquifier += 5000; /* just in case there are still file copies
from the old RW volume around */
+ /* For ROs, the copyDate contains the time that the RO volume was actually
+ * created, and the creationDate just contains the last time the RO was
+ * copied from the RW data. So, make the new RW creationDate more accurate
+ * by setting it to copyDate, if copyDate is older. Since, we know the
+ * volume is at least as old as copyDate. */
+ if (vd.copyDate < vd.creationDate) {
+ vd.creationDate = vd.copyDate;
+ } else {
+ /* If copyDate is newer, just make copyDate and creationDate the same,
+ * for consistency with other RWs */
+ vd.copyDate = vd.creationDate;
+ }
+
p = strrchr(vd.name, '.');
if (p && !strcmp(p, ".readonly")) {
memset(p, 0, 9);
vd.inUse = 0;
vd.uniquifier += 5000; /* just in case there are still file copies from
* the old RW volume around */
+
+ /* For ROs, the copyDate contains the time that the RO volume was actually
+ * created, and the creationDate just contains the last time the RO was
+ * copied from the RW data. So, make the new RW creationDate more accurate
+ * by setting it to copyDate, if copyDate is older. Since, we know the
+ * volume is at least as old as copyDate. */
+ if (vd.copyDate < vd.creationDate) {
+ vd.creationDate = vd.copyDate;
+ } else {
+ /* If copyDate is newer, just make copyDate and creationDate the same,
+ * for consistency with other RWs */
+ vd.copyDate = vd.creationDate;
+ }
+
p = strrchr(vd.name, '.');
if (p && !strcmp(p, ".readonly")) {
memset(p, 0, 9);