]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-pag-allocation-dont-throttle-when-time-reverses-20080104
authorDerrick Brashear <shadow@dementia.org>
Fri, 4 Jan 2008 18:40:30 +0000 (18:40 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 4 Jan 2008 18:40:30 +0000 (18:40 +0000)
LICENSE IPL10
avoid pag allocation throttling when time is set back by e.g. ntpd to avoid starving everyone.

(cherry picked from commit 02dc91892c41163f24c818615d13271b074df3ca)

src/afs/afs_osi_pag.c

index 78a2246ddebc8710be2f278aec870c6ca3b21f5a..5f7eaf6f16ceb167bb100cead9c47763b5dbd7f0 100644 (file)
@@ -145,6 +145,7 @@ getpag(void)
  */
 
 static int afs_pag_sleepcnt = 0;
+static int afs_pag_timewarn = 0;
 
 static int
 afs_pag_sleep(struct AFS_UCRED **acred)
@@ -155,6 +156,13 @@ afs_pag_sleep(struct AFS_UCRED **acred)
        if(osi_Time() - pag_epoch < pagCounter) {
            rv = 1;
        }
+       if (rv && (osi_Time() < pag_epoch)) {
+           if (!afs_pag_timewarn) {
+               afs_pag_timewarn = 1;
+               printf("clock went backwards, not PAG throttling");
+           }
+           rv = 0;
+       }
     }
 
     return rv;