lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZbNwjbXyue2-HIr_@google.com>
Date: Fri, 26 Jan 2024 00:42:53 -0800
From: Jaegeuk Kim <jaegeuk@...nel.org>
To: Chao Yu <chao@...nel.org>
Cc: linux-f2fs-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] f2fs: use printk_ratelimited to avoid redundant logs

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@...nel.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()?

> +		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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ