mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Fix time database update calculations
The time database update math assumed that the timestamps were in
nanoseconds, but at some point in the development or review process they
changed to seconds. This PR fixes the math to use seconds instead.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Closes #17735
This commit is contained in:
committed by
Brian Behlendorf
parent
c9de42e089
commit
cac483dbd4
@@ -162,9 +162,9 @@ dbrrd_add(dbrrd_t *db, hrtime_t time, uint64_t txg)
|
||||
daydiff = time - rrd_tail(&db->dbr_days);
|
||||
monthdiff = time - rrd_tail(&db->dbr_months);
|
||||
|
||||
if (monthdiff >= 0 && monthdiff >= SEC2NSEC(30 * 24 * 60 * 60))
|
||||
if (monthdiff >= 0 && monthdiff >= 30 * 24 * 60 * 60)
|
||||
rrd_add(&db->dbr_months, time, txg);
|
||||
else if (daydiff >= 0 && daydiff >= SEC2NSEC(24 * 60 * 60))
|
||||
else if (daydiff >= 0 && daydiff >= 24 * 60 * 60)
|
||||
rrd_add(&db->dbr_days, time, txg);
|
||||
else if (minutedif >= 0)
|
||||
rrd_add(&db->dbr_minutes, time, txg);
|
||||
|
||||
Reference in New Issue
Block a user