All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: set flag to message when ratelimited
@ 2024-09-13 21:26 Leo Martins
  2024-09-13 22:58 ` Omar Sandoval
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Leo Martins @ 2024-09-13 21:26 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

Set RATELIMIT_MSG_ON_RELEASE flag to send a message when being
ratelimited. During some recent debugging not realizing that
logs were being ratelimited caused some confusion so making
sure there is a warning seems prudent.

Signed-off-by: Leo Martins <loemra.dev@gmail.com>
---
 fs/btrfs/messages.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/fs/btrfs/messages.c b/fs/btrfs/messages.c
index 77752eec125d9..22316067bde75 100644
--- a/fs/btrfs/messages.c
+++ b/fs/btrfs/messages.c
@@ -199,14 +199,22 @@ static const char * const logtypes[] = {
  * messages doesn't cause more important ones to be dropped.
  */
 static struct ratelimit_state printk_limits[] = {
-	RATELIMIT_STATE_INIT(printk_limits[0], DEFAULT_RATELIMIT_INTERVAL, 100),
-	RATELIMIT_STATE_INIT(printk_limits[1], DEFAULT_RATELIMIT_INTERVAL, 100),
-	RATELIMIT_STATE_INIT(printk_limits[2], DEFAULT_RATELIMIT_INTERVAL, 100),
-	RATELIMIT_STATE_INIT(printk_limits[3], DEFAULT_RATELIMIT_INTERVAL, 100),
-	RATELIMIT_STATE_INIT(printk_limits[4], DEFAULT_RATELIMIT_INTERVAL, 100),
-	RATELIMIT_STATE_INIT(printk_limits[5], DEFAULT_RATELIMIT_INTERVAL, 100),
-	RATELIMIT_STATE_INIT(printk_limits[6], DEFAULT_RATELIMIT_INTERVAL, 100),
-	RATELIMIT_STATE_INIT(printk_limits[7], DEFAULT_RATELIMIT_INTERVAL, 100),
+	RATELIMIT_STATE_INIT_FLAGS(printk_limits[0], DEFAULT_RATELIMIT_INTERVAL,
+				   100, RATELIMIT_MSG_ON_RELEASE),
+	RATELIMIT_STATE_INIT_FLAGS(printk_limits[1], DEFAULT_RATELIMIT_INTERVAL,
+				   100, RATELIMIT_MSG_ON_RELEASE),
+	RATELIMIT_STATE_INIT_FLAGS(printk_limits[2], DEFAULT_RATELIMIT_INTERVAL,
+				   100, RATELIMIT_MSG_ON_RELEASE),
+	RATELIMIT_STATE_INIT_FLAGS(printk_limits[3], DEFAULT_RATELIMIT_INTERVAL,
+				   100, RATELIMIT_MSG_ON_RELEASE),
+	RATELIMIT_STATE_INIT_FLAGS(printk_limits[4], DEFAULT_RATELIMIT_INTERVAL,
+				   100, RATELIMIT_MSG_ON_RELEASE),
+	RATELIMIT_STATE_INIT_FLAGS(printk_limits[5], DEFAULT_RATELIMIT_INTERVAL,
+				   100, RATELIMIT_MSG_ON_RELEASE),
+	RATELIMIT_STATE_INIT_FLAGS(printk_limits[6], DEFAULT_RATELIMIT_INTERVAL,
+				   100, RATELIMIT_MSG_ON_RELEASE),
+	RATELIMIT_STATE_INIT_FLAGS(printk_limits[7], DEFAULT_RATELIMIT_INTERVAL,
+				   100, RATELIMIT_MSG_ON_RELEASE),
 };
 
 void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-24 22:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-13 21:26 [PATCH] btrfs: set flag to message when ratelimited Leo Martins
2024-09-13 22:58 ` Omar Sandoval
2024-09-14  0:18 ` Qu Wenruo
2024-09-17 16:30 ` David Sterba
2024-09-18  6:06   ` Naohiro Aota
2024-09-24 22:38     ` Leo Martins

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.