mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 05:57:43 +00:00
STABLE14-release-avoid-negative-time-20060124
avoid any possibility of time going negative when releasing incrementally (cherry picked from commit 179b4c31d93b511a5762c818a47cddc0e364c9d3)
This commit is contained in:
parent
d4f7d158b6
commit
079f1aeb3b
@ -56,6 +56,7 @@ RCSID
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#define ERRCODE_RANGE 8 /* from error_table.h */
|
#define ERRCODE_RANGE 8 /* from error_table.h */
|
||||||
#define CLOCKSKEW 2 /* not really skew, but resolution */
|
#define CLOCKSKEW 2 /* not really skew, but resolution */
|
||||||
|
#define CLOCKADJ(x) (((x) < CLOCKSKEW) ? 0 : (x) - CLOCKSKEW)
|
||||||
|
|
||||||
/* for UV_MoveVolume() recovery */
|
/* for UV_MoveVolume() recovery */
|
||||||
|
|
||||||
@ -1329,7 +1330,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
|
|||||||
newVol);
|
newVol);
|
||||||
VDONE;
|
VDONE;
|
||||||
|
|
||||||
fromDate = tstatus.creationDate - CLOCKSKEW;
|
fromDate = CLOCKADJ(tstatus.creationDate);
|
||||||
} else {
|
} else {
|
||||||
/* With RV_NOCLONE, just do a full copy from the source */
|
/* With RV_NOCLONE, just do a full copy from the source */
|
||||||
fromDate = 0;
|
fromDate = 0;
|
||||||
@ -2162,7 +2163,7 @@ UV_CopyVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
|
|||||||
cloneVol);
|
cloneVol);
|
||||||
VDONE;
|
VDONE;
|
||||||
|
|
||||||
fromDate = tstatus.creationDate - CLOCKSKEW;
|
fromDate = CLOCKADJ(tstatus.creationDate);
|
||||||
} else {
|
} else {
|
||||||
fromDate = 0;
|
fromDate = 0;
|
||||||
}
|
}
|
||||||
@ -2180,7 +2181,7 @@ UV_CopyVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
|
|||||||
VDONE;
|
VDONE;
|
||||||
|
|
||||||
/* Using the update date should be OK here, but add some fudge */
|
/* Using the update date should be OK here, but add some fudge */
|
||||||
cloneFromDate = tstatus.updateDate - CLOCKSKEW;
|
cloneFromDate = CLOCKADJ(tstatus.updateDate);
|
||||||
if ((flags & RV_NOCLONE))
|
if ((flags & RV_NOCLONE))
|
||||||
fromDate = cloneFromDate;
|
fromDate = cloneFromDate;
|
||||||
|
|
||||||
@ -3087,8 +3088,8 @@ GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
|
|||||||
code);
|
code);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
*crtimePtr = tstatus.creationDate - CLOCKSKEW;
|
*crtimePtr = CLOCKADJ(tstatus.creationDate);
|
||||||
*uptimePtr = tstatus.updateDate - CLOCKSKEW;
|
*uptimePtr = CLOCKADJ(tstatus.updateDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user