bcachefs: ratelimit copygc warning
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 4 Apr 2019 00:38:37 +0000 (20:38 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:20 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bcachefs.h
fs/bcachefs/movinggc.c

index d8a9d4962d709c78e38c8caa86283015fbde8355..d8c487e3359253f3f77a95165056f8299121d0be 100644 (file)
        printk(KERN_NOTICE bch2_fmt(c, fmt), ##__VA_ARGS__)
 #define bch_warn(c, fmt, ...) \
        printk(KERN_WARNING bch2_fmt(c, fmt), ##__VA_ARGS__)
+#define bch_warn_ratelimited(c, fmt, ...) \
+       printk_ratelimited(KERN_WARNING bch2_fmt(c, fmt), ##__VA_ARGS__)
 #define bch_err(c, fmt, ...) \
        printk(KERN_ERR bch2_fmt(c, fmt), ##__VA_ARGS__)
 #define bch_err_ratelimited(c, fmt, ...) \
index 4bf4cc33dbb1e55c506e000df06954276842cb26..78d9ca8bfc5e39e6dcf52cf144033e7278ecb1ee 100644 (file)
@@ -209,7 +209,8 @@ static void bch2_copygc(struct bch_fs *c, struct bch_dev *ca)
        up_read(&ca->bucket_lock);
 
        if (sectors_not_moved && !ret)
-               bch_warn(c, "copygc finished but %llu/%llu sectors, %llu/%llu buckets not moved",
+               bch_warn_ratelimited(c,
+                       "copygc finished but %llu/%llu sectors, %llu/%llu buckets not moved",
                         sectors_not_moved, sectors_to_move,
                         buckets_not_moved, buckets_to_move);