Skip to content

Commit 02d82d9

Browse files
author
Paul Dagnelie
committed
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. Signed-off-by: Paul Dagnelie <paul.dagnelie@klarasystems.com> Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc.
1 parent 455c361 commit 02d82d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

module/zfs/zfs_crrd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ dbrrd_add(dbrrd_t *db, hrtime_t time, uint64_t txg)
162162
daydiff = time - rrd_tail(&db->dbr_days);
163163
monthdiff = time - rrd_tail(&db->dbr_months);
164164

165-
if (monthdiff >= 0 && monthdiff >= SEC2NSEC(30 * 24 * 60 * 60))
165+
if (monthdiff >= 0 && monthdiff >= 30 * 24 * 60 * 60)
166166
rrd_add(&db->dbr_months, time, txg);
167-
else if (daydiff >= 0 && daydiff >= SEC2NSEC(24 * 60 * 60))
167+
else if (daydiff >= 0 && daydiff >= 24 * 60 * 60)
168168
rrd_add(&db->dbr_days, time, txg);
169169
else if (minutedif >= 0)
170170
rrd_add(&db->dbr_minutes, time, txg);

0 commit comments

Comments
 (0)