Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp597787iog; Mon, 13 Jun 2022 08:51:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwt/gyQFCGf5hCZnc2kntIgRi1sy6vm/tj3/HikolhHR1FoijGs00u5K/UBnEJqohWWUPQT X-Received: by 2002:a17:907:7eaa:b0:6df:e82c:f84 with SMTP id qb42-20020a1709077eaa00b006dfe82c0f84mr451903ejc.590.1655135509610; Mon, 13 Jun 2022 08:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655135509; cv=none; d=google.com; s=arc-20160816; b=GbwSmL0Lxo0cAHkC6AiOYsg4/6U8tW7AYIJa0qgg+ctnis5jisXCExK9gwaBJJO4cK TM3KcQ4mRv81Pjzg3aGYdzpkzTej0F9S1idInnJ82YNs4plpiweBlCM3Pn6EY7CzrvfP B3R683k24VRzNsBcOhy0Om5GTC5JbRwWgskMu+FLPqtizQaetOb6x/m2ZA3NcuezuFVP L1hQz7a6fUSe6lo4Vw3MyFsvF7idF9hoVBBbah3EDDlN9PaFHY0Ga2p8cQMdO/6x7ktG YVlGYMG4XL8sO0THGuO8u6uE5HliF97qzUvHNtUfsG+NHm7ixnTOrCJq0bIX3P6LoFn3 4LSw== 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=I6z0wjvEjc8TyGn8Mf93ZIRUzqcOB4aotoEaT/eimNM=; b=f0BRtx6ZjObZEZq0OMPu/97At/S0obBm5ImduGGEWczJ3ZIFXJMW1xOkSoxYvaK57H 8XBD0rj+bbn1Jjaf8yLI1b7JQ/MU2r8kWmkGluRGUaNhTrpRKsrdZn2EhuL/npmAHbgK T0sYyO9mcfi8lv2FiwbAnrfqxtAB7XBvOZSBG5Ak+UVjmlrs84wsxwI+vITUOrcv2cZi ts6pkzMN1dTiYx8wbewlVcfoy3m4gBt1sRu9x4uqSD/Drf5i0YRvcY0HER2lkj5Pvrz+ 3+cCYV74Eypr0qig+Hcs+3Lk86p2Yq8NSbTQhWgNatXkCmFh4tDYCgXsIl2e3mEBteuZ uq/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dvIgO7ir; 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 e19-20020a17090658d300b00711caa783f0si8741826ejs.657.2022.06.13.08.51.24; Mon, 13 Jun 2022 08:51:49 -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=dvIgO7ir; 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 S1351592AbiFMLGl (ORCPT + 99 others); Mon, 13 Jun 2022 07:06:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350369AbiFMK6l (ORCPT ); Mon, 13 Jun 2022 06:58:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C337013D6B; Mon, 13 Jun 2022 03:32:26 -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 06FDE60EF5; Mon, 13 Jun 2022 10:32:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FF3AC341C7; Mon, 13 Jun 2022 10:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116345; bh=H4I09whxsh8ywfnFdOqNSd9DPvOqk92y/LG+KTeXnp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dvIgO7irOHKjoAxP7DFCsKnMNIRlUx2PJLxac9LEMzLITt03xXlhtO5AVeXQlsOON 1B0JalkOwGvkY/WRgv2UZdAGar9hp0s2moq7l8tDm5orU9ntv6E2KiXmib+NyHAkHw xkVj/RZ4w+RLVpUhXRFhzhrrYcTMY/ELDTe3DOMw= 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.4 069/411] fat: add ratelimit to fat*_ent_bread() Date: Mon, 13 Jun 2022 12:05:42 +0200 Message-Id: <20220613094930.585944291@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@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 3647c65a0f48..0191eb1dc7f6 100644 --- a/fs/fat/fatent.c +++ b/fs/fat/fatent.c @@ -93,7 +93,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; } @@ -106,8 +107,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