f2fs: use f2fs_err_ratelimited() to avoid redundant logs

[ Upstream commit 0b8eb814e05885cde53c1d56ee012a029b8413e6 ]

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>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Stable-dep-of: ca8b201f2854 ("f2fs: fix to avoid potential deadlock")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Chao Yu
2025-12-30 11:15:38 -05:00
committed by Greg Kroah-Hartman
parent 5ceea587c4
commit c375c4b399

View File

@@ -4054,7 +4054,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)
@@ -4097,8 +4099,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);
}