]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-volser-return-extended-stats-to-callers-20071015
authorRainer Toebbicke <rtb@pclella.cern.ch>
Mon, 15 Oct 2007 15:18:57 +0000 (15:18 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 15 Oct 2007 15:18:57 +0000 (15:18 +0000)
FIXES 74398

make sure when we roll over stats we return the new values

(cherry picked from commit 14e71a12b6da596880debc21c224b94c33a5b6f2)

src/volser/volprocs.c

index c604d5377a57bb39a94d7599bd2f7e354763b11a..7aabab2cd0bab2f4ba42823569450e34773edb27 100644 (file)
@@ -2063,11 +2063,6 @@ VolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID,
            xInfoP->accessDate = volDiskDataP->accessDate;
            xInfoP->updateDate = volDiskDataP->updateDate;
            xInfoP->backupDate = volDiskDataP->backupDate;
-           now = FT_ApproxTime();
-           if (now - volDiskDataP->dayUseDate > OneDay)
-               xInfoP->dayUse = 0;
-           else
-               xInfoP->dayUse = volDiskDataP->dayUse;
            xInfoP->filecount = volDiskDataP->filecount;
            xInfoP->maxquota = volDiskDataP->maxquota;
            xInfoP->size = volDiskDataP->diskused;
@@ -2075,8 +2070,15 @@ VolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID,
            /*
             * Copy out the stat fields in a single operation.
             */
-           memcpy((char *)&(xInfoP->stat_reads[0]),
+           now = FT_ApproxTime();
+           if (now - volDiskDataP->dayUseDate > OneDay) {
+               xInfoP->dayUse = 0;
+               memset((char *)&(xInfoP->stat_reads[0]), 0, numStatBytes);
+           } else {
+               xInfoP->dayUse = volDiskDataP->dayUse;
+               memcpy((char *)&(xInfoP->stat_reads[0]),
                   (char *)&(volDiskDataP->stat_reads[0]), numStatBytes);
+           }
 
            /*
             * We're done copying.  Detach the volume and iterate (at this