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]
Date:   Tue, 28 May 2019 09:23:15 +0800
From:   Chao Yu <yuchao0@...wei.com>
To:     Sahitya Tummala <stummala@...eaurora.org>,
        Jaegeuk Kim <jaegeuk@...nel.org>,
        <linux-f2fs-devel@...ts.sourceforge.net>
CC:     <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] f2fs: ratelimit recovery messages

Hi Sahitya,

On 2019/5/27 21:10, Sahitya Tummala wrote:
> Ratelimit the recovery logs, which are expected in case
> of sudden power down and which could result into too
> many prints.

FYI

https://lore.kernel.org/patchwork/patch/973837/

IMO, we need those logs to provide evidence during trouble-shooting of file data
corruption or file missing problem...

So I suggest we can keep log as it is in recover_dentry/recover_inode, and for
the log in do_recover_data, we can record recovery info [isize_kept,
recovered_count, err ...] into struct fsync_inode_entry, and print them in
batch, how do you think?

Thanks,

> 
> Signed-off-by: Sahitya Tummala <stummala@...eaurora.org>
> ---
> v2:
>  - fix minor formatting and add new line for printk
> 
>  fs/f2fs/recovery.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
> index e04f82b..60d7652 100644
> --- a/fs/f2fs/recovery.c
> +++ b/fs/f2fs/recovery.c
> @@ -188,8 +188,8 @@ static int recover_dentry(struct inode *inode, struct page *ipage,
>  		name = "<encrypted>";
>  	else
>  		name = raw_inode->i_name;
> -	f2fs_msg(inode->i_sb, KERN_NOTICE,
> -			"%s: ino = %x, name = %s, dir = %lx, err = %d",
> +	printk_ratelimited(KERN_NOTICE
> +			"%s: ino = %x, name = %s, dir = %lx, err = %d\n",
>  			__func__, ino_of_node(ipage), name,
>  			IS_ERR(dir) ? 0 : dir->i_ino, err);
>  	return err;
> @@ -292,8 +292,8 @@ static int recover_inode(struct inode *inode, struct page *page)
>  	else
>  		name = F2FS_INODE(page)->i_name;
>  
> -	f2fs_msg(inode->i_sb, KERN_NOTICE,
> -		"recover_inode: ino = %x, name = %s, inline = %x",
> +	printk_ratelimited(KERN_NOTICE
> +			"recover_inode: ino = %x, name = %s, inline = %x\n",
>  			ino_of_node(page), name, raw->i_inline);
>  	return 0;
>  }
> @@ -642,11 +642,11 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
>  err:
>  	f2fs_put_dnode(&dn);
>  out:
> -	f2fs_msg(sbi->sb, KERN_NOTICE,
> -		"recover_data: ino = %lx (i_size: %s) recovered = %d, err = %d",
> -		inode->i_ino,
> -		file_keep_isize(inode) ? "keep" : "recover",
> -		recovered, err);
> +	printk_ratelimited(KERN_NOTICE
> +			"recover_data: ino = %lx (i_size: %s) recovered = %d, err = %d\n",
> +			inode->i_ino,
> +			file_keep_isize(inode) ? "keep" : "recover",
> +			recovered, err);
>  	return err;
>  }
>  
> 

Powered by blists - more mailing lists