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 04:05:24 -0700
From:   Joe Perches <joe@...ches.com>
To:     Chao Yu <yuchao0@...wei.com>, Gao Xiang <gaoxiang25@...wei.com>,
        Sahitya Tummala <stummala@...eaurora.org>
Cc:     Jaegeuk Kim <jaegeuk@...nel.org>, linux-kernel@...r.kernel.org,
        linux-f2fs-devel@...ts.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: ratelimit recovery messages

On Tue, 2019-05-28 at 15:37 +0800, Chao Yu wrote:
[]
> > > > > > diff --git 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);

Probably better to add and use a f2fs_msg_ratelimited macro.

And the generic f2fs_msg should add printf
format and argument verification.
---
 fs/f2fs/f2fs.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 9b3d9977cd1e..2373bc3cb267 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1798,6 +1798,7 @@ static inline int inc_valid_block_count(struct f2fs_sb_info *sbi,
 	return -ENOSPC;
 }
 
+__printf(3, 4)
 void f2fs_msg(struct super_block *sb, const char *level, const char *fmt, ...);
 static inline void dec_valid_block_count(struct f2fs_sb_info *sbi,
 						struct inode *inode,


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ