Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2181253iof; Tue, 7 Jun 2022 22:23:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7z6eG37oTFe7N3cbp3DwUkj4d7x2q+rMkxuVN1KeRKmHQhxCpNRfpCEXygzuTGdbLN9Cn X-Received: by 2002:a17:903:186:b0:167:6d8c:68ce with SMTP id z6-20020a170903018600b001676d8c68cemr18003089plg.153.1654665836783; Tue, 07 Jun 2022 22:23:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654665836; cv=none; d=google.com; s=arc-20160816; b=sbWDy+NpNjgTOuq0nRU8pYD2wuTbcwCIEocK80XShIzdx8veLNn2B8W9J/eN+H36eH E692PZOuO+IX9ZFk4nqvNUw4KwbF5Dp5/RK3ryoDvgZVaH+zGpdYL1dfukrHZgCIepRF deM7OSfQ/CQvCQ8CM+2ykyuOQrGWZYmKEvoGJVQsLtku/2JDx/iuoZiwVFLi63SoyDWr OZ8ln1PQiCBXGV/hNbNooJ3lOI5xFR9Tb+9+rb+1HNTQcL5Y6saQ4+cb6YSE5fOsy9JH PfuU1FfesE8K4rAceX4g1NziWcOWlXl6BNUX8nVxP7ncXQ0ucXwOzgy/J8y7wNmWDmIN lcaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=an/bLuAXGPzRX8JaAztEF/j0Ie0gW2HCRSfdRRzU0Uk=; b=HcvXM/rdEl9JqjfaJH9rHLjx61KYmdJ+DEm4BPRM66ts5UI7xw8pD5eBqdw2ErUSf3 SpBY4R3ho1Y7y0GosoZwYw9/GGm7rkIBklgNSi7Sxt8tC1Fd7A57EP5ocDquMX4+72bN oVVaT64/QWLi2t+iLHs/AoNK716iAFEBiXMqXGkQwvIlCCdfQ1WcFJaIkDfzcub/sIOb 1u1vQYBXqIXL9s+ywGoBRHATx/sLZmH2F0l68jV+f9D8OqBPXTPf3TJFgenQSETJcZtz 4EBCze8gSE/Ffduvnd/zRb1JDYIzN6VaArGte5aZEwjv8w55h9uTRSCEc3FPVGzEGuXm RnJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HbYuhywt; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v11-20020a63f84b000000b003faf4fe0274si27507078pgj.140.2022.06.07.22.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:23:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HbYuhywt; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BE4353CAF68; Tue, 7 Jun 2022 21:50:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382804AbiFGWV7 (ORCPT + 99 others); Tue, 7 Jun 2022 18:21:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380682AbiFGVQl (ORCPT ); Tue, 7 Jun 2022 17:16:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1011221F99A; Tue, 7 Jun 2022 11:56:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 90B9CB81FE1; Tue, 7 Jun 2022 18:56:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE0C4C385A2; Tue, 7 Jun 2022 18:56:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628161; bh=FTiI156Bl/R9a/IH+dywYgcf8JKm5MuzE4oQ6KL5C9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HbYuhywtT798ruk1VW5mLXvo/yKpG6fGSiJouXicq3JA9FsMIt6BWrpPAPTLJ3VRN e8CjnbtX+/otF3NIjHHOJVkzsEthy5SXNfyPvM7c/bvG8+b8+YJ0snp/nybcqbWkmN D0lu5W370nmFubQ+WWZ2ZPmfwtNABvmqBqm++qqw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, OGAWA Hirofumi , qianfan , Andrew Morton , Sasha Levin Subject: [PATCH 5.18 227/879] fat: add ratelimit to fat*_ent_bread() Date: Tue, 7 Jun 2022 18:55:45 +0200 Message-Id: <20220607165009.442191631@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: OGAWA Hirofumi [ Upstream commit 183c3237c928109d2008c0456dff508baf692b20 ] fat*_ent_bread() can be the cause of too many report on I/O error path. So use fat_msg_ratelimit() instead. Link: https://lkml.kernel.org/r/87bkxogfeq.fsf@mail.parknet.co.jp Signed-off-by: OGAWA Hirofumi Reported-by: qianfan Tested-by: qianfan Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- fs/fat/fatent.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c index 978ac6751aeb..1db348f8f887 100644 --- a/fs/fat/fatent.c +++ b/fs/fat/fatent.c @@ -94,7 +94,8 @@ static int fat12_ent_bread(struct super_block *sb, struct fat_entry *fatent, err_brelse: brelse(bhs[0]); err: - fat_msg(sb, KERN_ERR, "FAT read failed (blocknr %llu)", (llu)blocknr); + fat_msg_ratelimit(sb, KERN_ERR, "FAT read failed (blocknr %llu)", + (llu)blocknr); return -EIO; } @@ -107,8 +108,8 @@ static int fat_ent_bread(struct super_block *sb, struct fat_entry *fatent, fatent->fat_inode = MSDOS_SB(sb)->fat_inode; fatent->bhs[0] = sb_bread(sb, blocknr); if (!fatent->bhs[0]) { - fat_msg(sb, KERN_ERR, "FAT read failed (blocknr %llu)", - (llu)blocknr); + fat_msg_ratelimit(sb, KERN_ERR, "FAT read failed (blocknr %llu)", + (llu)blocknr); return -EIO; } fatent->nr_bhs = 1; -- 2.35.1