diff mbox series

[f2fs-dev,2/2] f2fs: use f2fs_err_ratelimited() to avoid redundant logs

Message ID 20240126151917.837565-2-chao@kernel.org (mailing list archive)
State Accepted
Commit 9a63d6e6382a93b8c6fa7f53d1ec64d9b87e7293
Headers show
Series [f2fs-dev,1/2] f2fs: support printk_ratelimited() in f2fs_printk() | expand

Commit Message

Chao Yu Jan. 26, 2024, 3:19 p.m. UTC
Use f2fs_err_ratelimited() to instead f2fs_err() in
f2fs_record_stop_reason() and f2fs_record_errors() to
avoid redundant logs.

Signed-off-by: Chao Yu <chao@kernel.org>
---
 fs/f2fs/super.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 4ca390363131..f0fa76d227e4 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -4096,7 +4096,9 @@  static void f2fs_record_stop_reason(struct f2fs_sb_info *sbi)
 
 	f2fs_up_write(&sbi->sb_lock);
 	if (err)
-		f2fs_err(sbi, "f2fs_commit_super fails to record err:%d", err);
+		f2fs_err_ratelimited(sbi,
+			"f2fs_commit_super fails to record stop_reason, err:%d",
+			err);
 }
 
 void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag)
@@ -4139,8 +4141,9 @@  static void f2fs_record_errors(struct f2fs_sb_info *sbi, unsigned char error)
 
 	err = f2fs_commit_super(sbi, false);
 	if (err)
-		f2fs_err(sbi, "f2fs_commit_super fails to record errors:%u, err:%d",
-								error, err);
+		f2fs_err_ratelimited(sbi,
+			"f2fs_commit_super fails to record errors:%u, err:%d",
+			error, err);
 out_unlock:
 	f2fs_up_write(&sbi->sb_lock);
 }