public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] f2fs: use printk_ratelimited to avoid redundant logs
Date: Fri, 26 Jan 2024 20:58:31 +0800	[thread overview]
Message-ID: <537604f3-cf30-45c2-8947-4c0adf9e37b1@kernel.org> (raw)
In-Reply-To: <ZbNwjbXyue2-HIr_@google.com>

On 2024/1/26 16:42, Jaegeuk Kim wrote:
> On 01/24, Chao Yu wrote:
>> Use printk_ratelimited() instead of 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 --git a/fs/f2fs/super.c b/fs/f2fs/super.c
>> index e2c066fbc0fa..7e437aea268e 100644
>> --- a/fs/f2fs/super.c
>> +++ b/fs/f2fs/super.c
>> @@ -4091,7 +4091,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);
> 
> Needing f2fs_err_ratelimited()?

Yes, more clean, let me update in v2.

Thanks,

> 
>> +		printk_ratelimited(
>> +			"%sF2FS-fs (%s): f2fs_commit_super fails to record stop_reason, err:%d\n",
>> +			KERN_ERR, sbi->sb->s_id, err);
>>   }
>>   
>>   void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag)
>> @@ -4134,8 +4136,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);
>> +		printk_ratelimited(
>> +			"%sF2FS-fs (%s): f2fs_commit_super fails to record errors:%u, err:%d\n",
>> +			KERN_ERR, sbi->sb->s_id, error, err);
>>   out_unlock:
>>   	f2fs_up_write(&sbi->sb_lock);
>>   }
>> -- 
>> 2.40.1

      reply	other threads:[~2024-01-26 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24 14:45 [PATCH] f2fs: use printk_ratelimited to avoid redundant logs Chao Yu
2024-01-26  8:42 ` Jaegeuk Kim
2024-01-26 12:58   ` Chao Yu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537604f3-cf30-45c2-8947-4c0adf9e37b1@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox