Skip to contentSkip to conversation

bcachefs: Fix incorrect a year to seconds calculation

PATCH Kent Overstreet 1 participant 1 message Oct 14, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 3966a95c-7ff1-49f9-90b0-3326fb21ecfe@Spark

#1 lore raw
Quoted 22 lines · Naoki MATSUMOTO

A year to seconds calculation includes '*7', but it is wrong. Fixed to accurate calculation.

---
 fs/bcachefs/time_stats.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bcachefs/time_stats.c +1 -2
index 3fe82757f..d9bddda45 100644
@@ -19,7 +19,7 @@ static const struct time_unit time_units[] = {
         { "h",          (u64) NSEC_PER_SEC * 3600},
         { "d",          (u64) NSEC_PER_SEC * 3600 * 24},
         { "w",          (u64) NSEC_PER_SEC * 3600 * 24 * 7},
-       { "y",          (u64) NSEC_PER_SEC * ((3600 * 24 * 7 * 365) + (3600 * (24 / 4) * 7))}, /* 365.25d */
+       { "y",          (u64) NSEC_PER_SEC * ((3600 * 24 * 365) + (3600 * (24 / 4)))}, /* 365.25d */
         { "eon",        U64_MAX          },
  };
 
--
Quoted 1 line

2.34.1

patch is mangled