bcachefs: fix warning about uninitialized time_stats
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 24 Dec 2023 03:55:05 +0000 (22:55 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Jan 2024 16:47:42 +0000 (11:47 -0500)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/util.c

index 00ddd91ddfcc8eecc920114bdd3290d3ffa913e0..d530277f9017ac0a20def4101900ddd67993cb75 100644 (file)
@@ -447,9 +447,9 @@ void __bch2_time_stats_update(struct bch2_time_stats *stats, u64 start, u64 end)
 {
        unsigned long flags;
 
-       WARN_RATELIMIT(!stats->min_duration || !stats->min_freq,
-                      "time_stats: min_duration = %llu, min_freq = %llu",
-                      stats->min_duration, stats->min_freq);
+       WARN_ONCE(!stats->duration_stats_weighted.weight ||
+                 !stats->freq_stats_weighted.weight,
+                 "uninitialized time_stats");
 
        if (!stats->buffer) {
                spin_lock_irqsave(&stats->lock, flags);