From ef23397c301900e9e7050f8245e2a25b5eea1589 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 23 Dec 2023 22:55:05 -0500 Subject: [PATCH] bcachefs: fix warning about uninitialized time_stats Signed-off-by: Kent Overstreet --- fs/bcachefs/util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 00ddd91ddfcc..d530277f9017 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -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); -- 2.39.5