From patchwork Wed Jan 24 14:45:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 13529300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 201CAC47422 for ; Wed, 24 Jan 2024 14:45:25 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rSeVF-00070h-O4; Wed, 24 Jan 2024 14:45:22 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rSeVD-00070b-VC for linux-f2fs-devel@lists.sourceforge.net; Wed, 24 Jan 2024 14:45:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nsEXfTgUZdb7O/1sIzQN1ud74814hofAGDkAZxkm5U8=; b=WOXMvH++KVHs+mTJd4IfTl46q1 ROR4x4oJAhFygYrYiJqTf4lsILajefPY+hcsdQCI8DlioI9MfUE6TlFrMpXhm1CRgf3z6VS6isciq 8yNodIkk3IWQ+ycIpYBb4EnrIp7GnkUfPl3LPoGYtQ23CJJuDxq5/N/sa/F5pTpHw3m0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=nsEXfTgUZdb7O/1sIzQN1ud74814hofAGDkAZxkm5U8=; b=a gW8EFdPYpmrUrp9iv5xu1beZ0JhzSyeg36wMpMn49svDQCeKz4vQYH3qPGYNkgURmBo7/usRoUr0Y fizgWzwO5yS07md0b6O3nBqWVUolwCXJfgPaQj7Y8aolHnqZ6myRLoUe+dJppRyVAJSfkULf0QwFy T49unWp5AaHEvHHE=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rSeVB-0008TB-HU for linux-f2fs-devel@lists.sourceforge.net; Wed, 24 Jan 2024 14:45:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8734F61DAB for ; Wed, 24 Jan 2024 14:45:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95B78C43399; Wed, 24 Jan 2024 14:45:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706107512; bh=GmaYoIhCc4vPw5Lo1/sPZc2Sy8eWLhDLcOKDvMVTJ2w=; h=From:To:Cc:Subject:Date:From; b=JqkQ1rzSk81G/5oXUF5vcMSH2UZHazJHBuWisp7JuQJHVG2oIqbzkFhkn0rXELxgQ G5R2uXqeV+zN1N3MbpQSqsOz423fo50SAHbHP+2ItzD+9au1VGqrk1k75NPAJTT5W6 a5dtFwkf8kHu8bKIMmoVrmyPeAFAVOL8jRwfiSy59udfUX15cAKoa66i9Yubaj/seC pqwSXow7WXuXHh7C2c8AaJCjpEyyuX9C4aZ5OnW5G8IQzKK6ZGnd+8TOzeomNgKUhB FXN8ufRsme/VIWKSsFeAjINnzFaji1xRpNpvBZkHhJFNtc3Jkqd1zfVP2Xer3tFtHc ViUBKDhj5lm/w== From: Chao Yu To: jaegeuk@kernel.org Date: Wed, 24 Jan 2024 22:45:06 +0800 Message-Id: <20240124144506.15052-1-chao@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Headers-End: 1rSeVB-0008TB-HU Subject: [f2fs-dev] [PATCH] f2fs: use printk_ratelimited to avoid redundant logs X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 --- 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); + 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); }