Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp440154iog; Mon, 13 Jun 2022 06:03:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkT0C63d7ef0Fk491adG6aXbwI1NXS/z+v2Bt7y36VTHRr11wH7A/m9XKwWDD24p6gYo51 X-Received: by 2002:a17:906:77de:b0:712:1130:eb7b with SMTP id m30-20020a17090677de00b007121130eb7bmr17410035ejn.106.1655125438750; Mon, 13 Jun 2022 06:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125438; cv=none; d=google.com; s=arc-20160816; b=z8H1wByw6sNytDWSC6Ca5qdgulQ7nYEmZtYPuknSia9NrHA7JszR9QRnb6Vm095xx+ w5hgB/DG9nRThT99mu2f3bMVgxuhB5N+JaXxIX7shyASGHKX/NzNGy3eKmgpWh6W6NhF 2tqhiNJRj9XH6vzsJbAtlizOYpW7DU6Tn/Y/ARA6FN8/sqPhUXLiI0uIqvf02tQumFIi 2FKym1EeNm8ePYaEP2wBTBMOT2HGg3TE4fQLRWtImhAbxIu6fBeHl0LbrcpKuexNZPUN o5Bb+QwDOqLk4hqX4OP0OqjwZ2SUDpMvRrCsDtMFtzNkQedwV4jngohkces7B0RuLbRG XJYw== 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=WEfvswC1Wm20tbzp1k8wa+0+emTsJB4Ghunw6ZNkKXc=; b=ry6UcIRFkOlklq34Mslm7OzMSs6kCUdWNufuUy3vPud+bckCTGw7E6igs6GfG5iWKY 9s0UVN6f7vJu072hE6CbUSSN3HgFUdIKQdNeNeHYYLMAgfCbfywvW6NjZC11EdDrp+4e PV2ofnKtiex+cjeJrVuE1rO4k+MN84mSYxOCg0YSNH/3Fv+FBgoN4MGZU8DfLlNdFdVg qpsZRyHvzFQT96M0LX2KvY6hL6mqQ1HrKcI0pycLMjrnq2b16ViY8G1deg+seXqsGBHz wsFWIbxJeIr1jT+05ZzoyoZJlZ2N1CaFM0lc6KoxctbiMoZxKYYFvS8VFT6B/n8rJGvc p9wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n1AnoGc+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v16-20020a17090651d000b006fed9c581c8si7904754ejk.911.2022.06.13.06.03.30; Mon, 13 Jun 2022 06:03:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n1AnoGc+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241925AbiFMKRE (ORCPT + 99 others); Mon, 13 Jun 2022 06:17:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241918AbiFMKQj (ORCPT ); Mon, 13 Jun 2022 06:16:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 141E6E03B; Mon, 13 Jun 2022 03:15:18 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 466D26144E; Mon, 13 Jun 2022 10:15:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D551C34114; Mon, 13 Jun 2022 10:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115313; bh=lvbxb7mAlb7/kG5niCqFw2s1N/0n9eUI4WHhmjAKwLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n1AnoGc+I7YHR2yElw+GwwKt5BeN985BoMmT/wqzzl2dQyGm9FPm8FHhMMtV/qeyy VPq0QHAxC/7ZvwXE8VqBZakQJ1hmj2jPKkTMkobzsK/CrVQOhrosnYIF+f+kRaWwn3 jFvk92Hv+3T37Q/BFon15CKqS9FypaCsr+fj65RE= 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 4.9 029/167] fat: add ratelimit to fat*_ent_bread() Date: Mon, 13 Jun 2022 12:08:23 +0200 Message-Id: <20220613094847.640455968@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094840.720778945@linuxfoundation.org> References: <20220613094840.720778945@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=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 0129d4d07a54..b0b1a71c07b7 100644 --- a/fs/fat/fatent.c +++ b/fs/fat/fatent.c @@ -92,7 +92,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; } @@ -105,8 +106,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