Handle backupDate of zero
authorBenjamin Kaduk <kaduk@mit.edu>
Wed, 10 Dec 2014 19:07:14 +0000 (14:07 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 11 Feb 2015 14:07:28 +0000 (09:07 -0500)
In older versions of OpenAFS (prior to 2001), the backupDate was
never set.  Try to provide somewhat more reasonable behavior in
this case, by using a different date in that case.

Change-Id: Id74ce003c6a2317b06e78ba64d6891229c16421a
Reviewed-on: http://gerrit.openafs.org/11627
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/volser/dumpstuff.c
src/volser/vol-dump.c

index 3835031..21ed803 100644 (file)
@@ -1045,7 +1045,9 @@ DumpDumpHeader(struct iod *iodp, Volume * vp,
        dumpTimes[1] = V_creationDate(vp);      /* until clone was updated */
        break;
     case backupVolume:
-       dumpTimes[1] = V_backupDate(vp);        /* until backup was made */
+       /* until backup was made */
+       dumpTimes[1] = V_backupDate(vp) != 0 ? V_backupDate(vp) :
+                                              V_creationDate(vp);
        break;
     default:
        code = EINVAL;
index c78f1c5..f8ed4be 100644 (file)
@@ -383,7 +383,9 @@ DumpDumpHeader(int dumpfd, Volume * vp, afs_int32 fromtime)
        dumpTimes[1] = V_creationDate(vp);      /* until clone was updated */
        break;
     case backupVolume:
-       dumpTimes[1] = V_backupDate(vp);        /* until backup was made */
+       /* until backup was made */
+       dumpTimes[1] = V_backupDate(vp) != 0 ? V_backupDate(vp) :
+                                              V_creationDate(vp);
        break;
     default:
        code = EINVAL;