Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4878779ybi; Tue, 28 May 2019 04:08:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFt6uB1GwVd18VIyBtVdShzJjHuOzMKVAUPbPBi0lIA9ZoeGp5pXN4topMpSrWBS4wV5Bq X-Received: by 2002:a63:1663:: with SMTP id 35mr344540pgw.253.1559041692776; Tue, 28 May 2019 04:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559041692; cv=none; d=google.com; s=arc-20160816; b=zA5JYgI9j5aEi2kXPCZCqrPfz/JcHUOR2AdyhkRGokt9R6AOtA03CqCUKJ/gdYGGve 8ExRRxkx7+Kyrw4KXKveepqlmNis0K38cuxPpLOBNFunvurwL4SWPLU7V5m7MVzmty7H rpl6Ia/vRbrNeoGgn5OFNtkGLioYx7CMTiln8PiifGJrzTSeHg6sc1XTYwxOAAt+GaJX YUulhwRD5hnGXrg6lxm77PqrkVnYTl1dNTKQr4Q18hdUPi5dXKjR0Q7dZWQCYWrgWY8G y286zL5I0ENcimFE+LDgxg9QRmYGzWYmDjYvgaj0QeANdue+iNO7ALzCnXh8Ujqh/1bh Q56Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=FxEQQh/WVcZfr7cvJ8oNLUp74ri+PJ/mFfv4md5HnAE=; b=JDkHhq1e6D4/cfE//LCXCGUJAmjCwqlKrHCLC9P31iV8Lf3APsj8PBwIWUCHThQNec j1KLz5nvjzsnvWZOnggVv6W/7I77fCgLM9LSnp2bwTcIsilL+EeCyTUsPFmdT1Zx3RZ1 R2xAe93wrI+5VptBkDU28Yh1tewyDyeHJt7T2YEF76LuoNBHn506LrlybRhBtRVDkm6t 5iD6MKAF5/JgN7Y5qDg9tAmCx6OFKmaMnacp/dHvirJ4FdaavSNpcaN78xksNsLcFs5p pGpjtVzz3abguNsjF/MzVIY1V0xAtFfPd2tWUMvF3xGFw0pxYZ+kmOr3ZJYNatOfFDPB ck6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s14si24858265pfc.146.2019.05.28.04.07.56; Tue, 28 May 2019 04:08:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbfE1LF2 (ORCPT + 99 others); Tue, 28 May 2019 07:05:28 -0400 Received: from smtprelay0137.hostedemail.com ([216.40.44.137]:52691 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726313AbfE1LF2 (ORCPT ); Tue, 28 May 2019 07:05:28 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 022CA182CED34; Tue, 28 May 2019 11:05:27 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1981:2194:2198:2199:2200:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:4321:5007:10004:10400:10848:11026:11658:11914:12043:12296:12438:12555:12740:12760:12895:12986:13069:13132:13231:13311:13357:13439:14096:14097:14659:14721:21080:21212:21627:30029:30054:30069:30091,0,RBL:23.242.196.136:@perches.com:.lbl8.mailshell.net-62.8.0.180 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:36,LUA_SUMMARY:none X-HE-Tag: legs83_4c81ae6e44a07 X-Filterd-Recvd-Size: 2509 Received: from XPS-9350.home (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf05.hostedemail.com (Postfix) with ESMTPA; Tue, 28 May 2019 11:05:25 +0000 (UTC) Message-ID: <6cc73c5454785faec229c8b78e63170e021a7c0d.camel@perches.com> Subject: Re: [f2fs-dev] [PATCH v2] f2fs: ratelimit recovery messages From: Joe Perches To: Chao Yu , Gao Xiang , Sahitya Tummala Cc: Jaegeuk Kim , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Date: Tue, 28 May 2019 04:05:24 -0700 In-Reply-To: <0341eb2c-6788-1c85-2036-ed57b7f99dab@huawei.com> References: <1558962655-25994-1-git-send-email-stummala@codeaurora.org> <94025a6d-f485-3811-5521-ed5c9b4d1d77@huawei.com> <20190528030509.GE10043@codeaurora.org> <2575bd54-d67c-6b26-ebf7-d6adb2e193a7@huawei.com> <0341eb2c-6788-1c85-2036-ed57b7f99dab@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = ""; > > > > > > 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,