Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3796383ybi; Mon, 27 May 2019 06:13:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaswxxOq68XKzMUn7JTm0M2+its3w0cL1KAxx+U5nh9+VjfbT9lh2xiALki8u+9TVcmdzH X-Received: by 2002:a63:5c5b:: with SMTP id n27mr127706450pgm.52.1558962818237; Mon, 27 May 2019 06:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558962818; cv=none; d=google.com; s=arc-20160816; b=BYLtIMwM4wTE6u+XWjuivWxJUvlR6X2kqkabN6/P63X9xgXngZlK0aa6WXRnhf66i/ /+lYnfBf55iEcYPLNSSigcSaIrzBNdQB3LtKl43N9n3HhGPDomgaPS6urMtTnYa4WcwE 4xJ+NO+PC2uuK9cedh+dw/fFc+qmy5RVIhWLbwll8RTckVx6cLZOjsRcqmKCfiIEViIr hm2C7l0zrkPTbKqxuVbG+tUETcQ8K+jnG3Msiyu1Jk8h7qkoUMRviIBLY3B0mh4ozZPk EdBR2EVetOYHY6uBal2v5NIl1uPGxTEXnlbGOuQywIhTT1kjiDsUtjgcPxco87CGoUeF Crjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature; bh=UmivGaHxUkuboEHTpj/IC5GRZpe0ONF25+zFxp8fSDA=; b=pxh4fok0IdPg1A8xDHiX86troKd9+a/a9JVyy/PfIse1xl/aZYAtlFiVl4YczwKvPX lScSKjonDWE6d5Ba/Xj53voUOBw+lyd3Mdzt4VD01ZF6Ny3HOqBN7QemEX1wkemaLZvw MdDmWz8idEBjSpYEwjT2/zUYF8ZuIbgjpPOYRe3PpWu2QPrl+/ozYmWcOFeuh6wH1L8L ydJlscKfIFZOgpNq356NxaoH0UgA8dBHCf9MfNIsDCx8w1dKIYv/YI1TqSIqLqLNv2Fg F7lr4KCPrp4EQjJ9X9Xr3KZfKXBihdEuny2pLiZf5XnypaJJnqE9ORC9NRExILUCDnnj IZTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=MmnicGkR; dkim=pass header.i=@codeaurora.org header.s=default header.b=VEWjIQOw; 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 b16si20308691pgk.387.2019.05.27.06.13.22; Mon, 27 May 2019 06:13:38 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=MmnicGkR; dkim=pass header.i=@codeaurora.org header.s=default header.b=VEWjIQOw; 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 S1726276AbfE0NLM (ORCPT + 99 others); Mon, 27 May 2019 09:11:12 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:36942 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725991AbfE0NLM (ORCPT ); Mon, 27 May 2019 09:11:12 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4D32D6019D; Mon, 27 May 2019 13:11:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1558962671; bh=vgQHKjatuuR2l1jDszVWwCc/xyVrmWfL4GYi56xMaTY=; h=From:To:Cc:Subject:Date:From; b=MmnicGkRTYq9gwqqJLY1E7kWPavHb/K56l7da0LKv0ULSS2rKnxJW8l9EbvYtsmfn ui2SsoLOaOVyQaI0pDhU6XO6vE8hElxq8lGy9eWlg8q5Sdk0g0wMY/Ex0boV4rOnk7 0kW7uvixMt4eHYuMzmL1PjmJIidau8jIB6ROp+tQ= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,SPF_NONE,T_FILL_THIS_FORM_SHORT autolearn=no autolearn_force=no version=3.4.0 Received: from codeaurora.org (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: stummala@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C3FDB6019D; Mon, 27 May 2019 13:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1558962670; bh=vgQHKjatuuR2l1jDszVWwCc/xyVrmWfL4GYi56xMaTY=; h=From:To:Cc:Subject:Date:From; b=VEWjIQOwqdA0P1ReYmBt320WWrqap1AU8BbKYGiflJ7uvOFqtZhtwQJF6xchI/528 eu2lAv2LCAlp6sGlXmqigxP0eSJENQlhW/1OJtQscI87gBosjv9oVtZiAzE98Erevo 0e49zF8c/L9J7rtMTRlkiZDz28+IXGjsedIs03NU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C3FDB6019D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=stummala@codeaurora.org From: Sahitya Tummala To: Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net Cc: Sahitya Tummala , linux-kernel@vger.kernel.org Subject: [PATCH v2] f2fs: ratelimit recovery messages Date: Mon, 27 May 2019 18:40:55 +0530 Message-Id: <1558962655-25994-1-git-send-email-stummala@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ratelimit the recovery logs, which are expected in case of sudden power down and which could result into too many prints. Signed-off-by: Sahitya Tummala --- 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 = ""; 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; } -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.