From patchwork Tue Jan 30 07:31:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuezhang.Mo@sony.com" X-Patchwork-Id: 13536944 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4C53524AC for ; Tue, 30 Jan 2024 07:32:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=185.183.30.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706599956; cv=fail; b=AmQRfORJ/lZ0nbqkSvJW1FtO5rbL8DQ3bs+r4c+oV81t6q9o4fFBYuv56r2HDn7x/QVqTmENKyizYm+AYpuWxLzFnvlFQY+LDtd/lLQWg/c2q7kQ1jaf40Ir8pk7K0Et0vjT2SpsFofBrMvifLBu5O3XIb+dEsitqBZJQoLaG+Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706599956; c=relaxed/simple; bh=VJBfL6eZ+P/Th/0H/i1EvAKSsmKhhyeuc8zZ8uhOj1Y=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=eKXhrNSp1hccCvAUc+fjg6cV01ulHQ4wB9poN8V5J2ZGiAy/awR98D3IpbXw261IReOC3RfSQKNLVJzYjOF9CG7JdgFXB52bb4E5hcuAmuzKTiRNQqea8JMIWP5/1HaQIkTHP5hTEImN6twzGvuzmUp73FS7EtKFA4nvrXqsNcY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com; spf=pass smtp.mailfrom=sony.com; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b=ot5PhONU; arc=fail smtp.client-ip=185.183.30.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sony.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b="ot5PhONU" Received: from pps.filterd (m0209323.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 40U70ZGu005582; Tue, 30 Jan 2024 07:32:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=S1; bh=EKxk+BO9BlLZ1nPdJgJjqCUkSbvhQYAhFwn8gXErzmM=; b=ot5PhONU7f8Rah1347Dxt1X9MdUXahFOErosfJCx8fkGM3exv3s+DD0Q5P4LhX0VH7ju WxLSf2nC+nqt0wErYQZMf0S9bBwGtIcAhWaDDU9+f/QtnH1b4atRrP+D9kfftiN2Cv+N /izzybOY+349/gFALrD0q9VyBIVZK/Cz7vk6wpEAAv3uxy7qqbhRadsbEFoDslGe7rOI aDzUcgQ4wg7BgegwrFYVS8ptkty+IMaCRVRysYrHj1RLfReQejUwT5OTTjwphll5aW0I bi8i+WknsV6vTjA11tO85w9BBeQfKjlYoMPdVlMuPVqxCvGD3cKrbOQROVxpfJixe6W2 eg== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2040.outbound.protection.outlook.com [104.47.110.40]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3vvs62thqu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Jan 2024 07:32:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bZERWQGbxZ6TC8duaExR/bmDsdsc4WQpxm/DI6yxDKn+8VBJaqzUz66A2OrgClBRGqB4yEAGwwDmGafz3cjwCB91wOiOcN9ShKqtctPXTa+iHidf+0ss+y9kKcNjTFRlVoAVlw4bPau0RQyEIxXKNPQnDHoa0R6j/xXtpE7DDMLm+spAV9+wK4F94lVn/pxjTMehwcD1yxyVzulmQZjokd+bmz1xinE51eTbgtHlQe7Qm69QcFT5tGEb4qtqjdkIY6gj/k6KYqGpi/UUNbWEWWiwOvN6CeoB3NHsFxnZ81C/TFTQPSepea33I1i0SABtyBM8UwmRgIklrnp76LnAtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EKxk+BO9BlLZ1nPdJgJjqCUkSbvhQYAhFwn8gXErzmM=; b=VspOLEiJ1ytx1KOcXfilx0W1CxeuKTnrwFRvwGFgysioDC1LeY4YXhhg8TszkBX6ls6723zTq/oDpmLlVkV3uAoYciJ+nc2/SMvjd/z5zWUXeMn7ZqRjo2k0ITaH2hMpdiRhJE5zcve7FXaqRfYB3YPMa2J01GclWszZBifejMl7Zc9J50yJXZ3LwajNeQQrbPZ6bf5W/T0DLjVRIKIdVApRY9qcMofVAU1GZh81PpbUQPzpUMCUrpeAKQrqHysBot/PLLeS6+XdAQ4VyC2kNOQF4YDe/YVY+7KcXWNbC88feqPwa5aQtGde6i5oFKzp/LQHYSWs+rgjKGPSOFHcjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sony.com; dmarc=pass action=none header.from=sony.com; dkim=pass header.d=sony.com; arc=none Received: from PUZPR04MB6316.apcprd04.prod.outlook.com (2603:1096:301:fc::7) by SEYPR04MB6483.apcprd04.prod.outlook.com (2603:1096:101:bd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.31; Tue, 30 Jan 2024 07:31:48 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::f0fc:7116:6105:88b2]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::f0fc:7116:6105:88b2%7]) with mapi id 15.20.7228.029; Tue, 30 Jan 2024 07:31:48 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" Subject: [PATCH v1] exfat: ratelimit error msg in exfat_file_mmap() Thread-Topic: [PATCH v1] exfat: ratelimit error msg in exfat_file_mmap() Thread-Index: AdpTN0UxqEMN3rFKRd2R4Fso5MmIQAAFuLNQ Date: Tue, 30 Jan 2024 07:31:48 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZPR04MB6316:EE_|SEYPR04MB6483:EE_ x-ms-office365-filtering-correlation-id: d2c5e810-e9f4-4652-0108-08dc216584f7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: M53jwp9iW3YVGMpdjNlrZv0zh/0mL+LcGg8FNFGoTtBdRxchNzwUoGv2f172BLx9w8hp/fCw9LMEw/fjkuxAt6narSKi2OceWRIavgGa2gcPQaaeA0dgZxagT4aDIZksQcg1Sp6tsF2cKVtK+D804tUiMtkkjryLAsnuuUuSdZu+1I+Fn6aVnPrqUBKMGmlcv5Qqep7Y95aFBgq4ePvapw/hqz1eBRoemd8RxoVLjBCI1L1DTg8Dp8VoAf8Vl7tVaZcuOQIXeciXxkuRcHmF0veXR8Zh6AnS6o+DzemAvkFbSdwsJQ6KWWtavIv5Lq+nsipy/oQC5O2iYdZdDR41fAqgxfl/03CUZPToao0HFqfnn9/qERRarJYx8iLTMX3+hWR8MqScJ+zemYRZAUjc94Twffl1BMbtlITRRNWGOtF55EX1q6PmFRqbNcLbbZeDX13RZ7mVb3cINncncnlpuMTIv4vvOzf7V5l4AtWEXRVHz3Gy+G9ts6Gob904SJleGPIjalJMfYn1QQoz9IfqH74Pq6awiLUVZQZcY7DmarCvAKOvDjWIG6inKzlJHyuWEs8TF79fmRpBaQMPBpcrHqxxuMgQyyF0FL6t8vzD7wcUfmRGisWs+mo+3LHWEBHo x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR04MB6316.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(376002)(39860400002)(136003)(366004)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(41300700001)(107886003)(55016003)(6506007)(7696005)(83380400001)(9686003)(26005)(4326008)(5660300002)(8936002)(8676002)(52536014)(66476007)(478600001)(122000001)(66446008)(64756008)(54906003)(71200400001)(316002)(82960400001)(66556008)(76116006)(66946007)(110136005)(86362001)(99936003)(38100700002)(38070700009)(2906002)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?m/z+QEQRp0+gwJDThfOo8T75VqvQ?= =?utf-8?q?vTOIXFNVp+V2hl3wjtWNUJILl8BYfCcPpsgDWF8mFGRXKp3rbd1pkO4SdjLtDKbmL?= =?utf-8?q?h2ftKQlF6uJWZNsQXnES536ydSNr/XZ6QcZIz0FQIb/zr//Ds2XSUbfUC4ljHI+qO?= =?utf-8?q?cLogBoDitJ0b6J46InFeiCzyNcL51WbFLASpRIpM73uzqeRhJlco3ub5uE1rvXYef?= =?utf-8?q?Y1ynaxnDIu6Lai2xHmtutNgz/ALRm8e9nBunQvt/Qc0y0lX+6a6ZdxSWxa4WxjIWq?= =?utf-8?q?Xfe+99LReh8Ka5evSKFcjMc4JtrYiIE/XqUa2AMGppQS6W0HqPy43Cd6VdQtOvmA6?= =?utf-8?q?CS96bL74FwteGvwCaQDfW7e6VZ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6JIvKJxroeTOVA7kVsyLdBseLFv?= =?utf-8?q?8VTcj9ZsYlab+kWlGTC76Anj5BObmJjHZ9YUI5GC4js4B/DZBpV8LqXR+a03E/4a2?= =?utf-8?q?ERBERcbcvG2uNNNKIvM7a5rIm4HJi41YSlO77JQS9v2WZwacnHrAnwCMsYqD2u4xS?= =?utf-8?q?2kA0HNjspHXfcSWRKlQ5j86bdbbzelcFZZqOk8qhFudnEImXdbA0SenF2V3tn7kQI?= =?utf-8?q?Z6TgfOLIusf7avfhIvDFSYAm22eaPx5rzBREg26E+Y9xp3VB+Y+XviJajDKXHlvrP?= =?utf-8?q?Ec1lVG9VHi6U?= Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: jowBG8vwq4QawU7v/pnjkTnkRNby4Qi1XKsCRZHOdwVDCpxFJmNM6/r9d5am4zUgmWXbyZQKz5WVajB1+jaUH5fUP1IbkugrEOHwj++ztYYL217F/nHsf4ie6VF3N8Sa/h4PYK9+kUzlzYdmJEF9Lwj6sXEwthrOGoTQD2MFunaZwiGooP++064l4MaIxL4Orgr5x6LjOkV2yM4CPn+xZU+hOKggRmPbfrs7AtbZXyS88W6PP+OL3DiVtkg8zYTPbIL3oMfOeIhExUURucowYYbiU3uPYpOaengFLFeIsbdVlo3yO9l+sbYHmE7KdwIIwnz1tRSm5FVrVhFcl1kWTatPuBPQG2CZEEz0Ov8CrDJPLXqP24l3Byj2hPNRsQ1/54y6DhjBPFqiHxpAo6Q3LgGPXQi/Fx9cnBYWlwx1LiFrRQiGzr3QbLxFTCm+gYgqEX2hOGW6X8vrfVQxIuOP9yYejymDFlzEQKQDEcbznSws/5WaU/tKXQj7Ur/qdqRGSy01dtfS7RpaS5EF0TtrLixdNgmznMy54Fvw0SJqMepxsl6v0dP6GFriyPgwQ/q4C29omHpxryOYwq6SE3bck+HkJU3hl7+9ma3klLfUPpg3vZbgyfgeYLOrZ1ZZTHSz X-OriginatorOrg: sony.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PUZPR04MB6316.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2c5e810-e9f4-4652-0108-08dc216584f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2024 07:31:48.5499 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 66c65d8a-9158-4521-a2d8-664963db48e4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: NBMfhXRQ1qH9NXtiWoRXzWV/2NEMFdhG2627XqcmPpzGCuiMZ1AiFlIGpumWFQg3q00gSNIOV9B25it0mL6lZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR04MB6483 X-Proofpoint-GUID: 6Kyv2ww8diddI0BXKN4atTOtmfP-jCqq X-Proofpoint-ORIG-GUID: 6Kyv2ww8diddI0BXKN4atTOtmfP-jCqq X-Sony-Outbound-GUID: 6Kyv2ww8diddI0BXKN4atTOtmfP-jCqq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-30_02,2024-01-29_01,2023-05-22_02 Ratelimit the error message of zeroing out data between the valid size and the file size in exfat_file_mmap() to not flood dmesg. Signed-off-by: Yuezhang Mo --- fs/exfat/exfat_fs.h | 5 +++++ fs/exfat/file.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index 9474cd50da6d..46f2760d9846 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -542,6 +542,11 @@ void __exfat_fs_error(struct super_block *sb, int report, const char *fmt, ...) /* expand to pr_*() with prefix */ #define exfat_err(sb, fmt, ...) \ pr_err("exFAT-fs (%s): " fmt "\n", (sb)->s_id, ##__VA_ARGS__) +#define exfat_err_ratelimit(sb, fmt, args...) \ + do { \ + if (__ratelimit(&EXFAT_SB(sb)->ratelimit)) \ + exfat_err(sb, fmt, ## args); \ + } while (0) #define exfat_warn(sb, fmt, ...) \ pr_warn("exFAT-fs (%s): " fmt "\n", (sb)->s_id, ##__VA_ARGS__) #define exfat_info(sb, fmt, ...) \ diff --git a/fs/exfat/file.c b/fs/exfat/file.c index 473c1641d50d..68405ae06772 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -619,7 +619,7 @@ static int exfat_file_mmap(struct file *file, struct vm_area_struct *vma) ret = exfat_file_zeroed_range(file, ei->valid_size, end); inode_unlock(inode); if (ret < 0) { - exfat_err(inode->i_sb, + exfat_err_ratelimit(inode->i_sb, "mmap: fail to zero from %llu to %llu(%d)", start, end, ret); return ret;