From patchwork Tue Feb 21 07:34:42 2023 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: 13147440 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDF38C61DA3 for ; Tue, 21 Feb 2023 07:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233657AbjBUHfD (ORCPT ); Tue, 21 Feb 2023 02:35:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232650AbjBUHe7 (ORCPT ); Tue, 21 Feb 2023 02:34:59 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D58B823302 for ; Mon, 20 Feb 2023 23:34:58 -0800 (PST) Received: from pps.filterd (m0209319.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31L6rl2Q003747; Tue, 21 Feb 2023 07:34:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=S1; bh=c1cMvyK3NSTnm5NRLqdZRfYYSZ/wK6CedQmmoBPGvt8=; b=dsv8e4nbs3uhWsBxWvm/0TWfuvMyhL2G+/XnMIeEx6vd+tvHTYMFl7E7dmrSAT7PkW9A gkK0cRWROCgJHlVdPg9o4t6Ij9U7RnFXa3+Rp7VIXzxEcJM3slOgcrQrMcg39F6VIfXz wT7mKMw6xVLnuw/wI4XW33oKXuUlnWAdo7vGxenIUI6LFqlzE6svwI4ts55Vb2tNWQ+u b/rjjnU4maE3GKXSmmC9XnQkgDs/ID+Ueub1oJIusJdW7uTNjC7SDfUGQV2zpznROq6S cZVII8d2Qm9jUJhZSwfuwIQNL7wrlXWiQu0wMiN2aaka81bZwhqKN7mhGbrFIeOrRecZ /w== Received: from apc01-tyz-obe.outbound.protection.outlook.com (mail-tyzapc01lp2046.outbound.protection.outlook.com [104.47.110.46]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3ntq2sttb1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Feb 2023 07:34:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KtP77k00/0T3XI3B8GAVKXHvxWgWQbCX5K9Lw/iEUuck8ML3FwfmnrYC1wf0OFDK4zPjg//RX2R8JV6wNolcBNcylvcde5v48lhZpuFDFivsLD1vHfgUu+g6VZ3O5TpqJVuxY2dZ5qZDTZvnxTwSfV2N5VLbQzV1ivO/Re6KGn0I4GHSaGI/oaN0HQyk9moFvAxWToKSDUEQCIASs5f8lrnGiT35y0LI+Kg4Ml5hMn8mwaEjYh+XNJlBdsjVTNxE95hf7hLWP5H6dQRtt/DZrwyEcNqctk3hxbBaR3gXew3akhPYiQUuoP/EriW+07jPb0xytvKtPNY0BbXQa8ge0w== 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=c1cMvyK3NSTnm5NRLqdZRfYYSZ/wK6CedQmmoBPGvt8=; b=GcxkF9eeih1IdLTkVo+Yvx378Llorm9HVaQOxTEPfwhzyngkNDs+hsJP5l1igiEd2Rfmdw4SQdmfhaRpvj294WqwyEaoTqAa1raQBIezGtUM3nBJB/hVkTWEKFmoh8sFf+AlfswKAbPZY0cn1r1dK9WIXccnS2NL/THyVmTRjVkxvCtKyCFnMJRegp/61Yw8wpe02GVtbeu1t30TZHENBQ99FBQjfQbl1hM+rrt3BUF5z6vOQFbZMPy1pptqwvFpIZ7u4Np2tudQlHTWoZtpk37vU5UyRsmXW6g0/ZxzvuE/ieEck4pDePIs1KzWiHp+rFZLAje+LzB+tkFFrzJk/w== 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 PSAPR04MB4165.apcprd04.prod.outlook.com (2603:1096:301:34::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21; Tue, 21 Feb 2023 07:34:42 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::779:3520:dde5:4941]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::779:3520:dde5:4941%7]) with mapi id 15.20.6111.020; Tue, 21 Feb 2023 07:34:42 +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 2/3] exfat: don't print error log in normal case Thread-Topic: [PATCH 2/3] exfat: don't print error log in normal case Thread-Index: AdlFxiFlnzIOBZgURkO2gsQA24A40Q== Date: Tue, 21 Feb 2023 07:34:42 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZPR04MB6316:EE_|PSAPR04MB4165:EE_ x-ms-office365-filtering-correlation-id: 60ee57f1-a70a-4c4f-6b30-08db13de1904 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jFNkGFhvGH5j29AFXGx3Zt2eBfNHYO2DwZHJhObdHdm+mABCk4XTGCKSdPCYApD4jJm8Qxp16MkCF6xG2oyHY2VzG/fk/F9zyJl851Gh9BOWQRiVX48oEipyzYINgKjEkYiHt1nGUg9blULAsMxG714zcG4qaeqBTdtCkKJR/Z3te7lZC/XhZIXGElI0hdcdSWgmnN6QESq4INHbxVmxPK2jbaWNyuJ26Cegd3m3fZuPDjofnJNCR3CeoayEC5gYaQ8U8wJWga2RyoIqVMrNuMXiZ1qopkf3jwUtUmLhgPKTVjggfB48mAgbYBSYpRa/FwucW7sPgk6ft31eHz4IW6rdJwc4beEbx5Qe2/qI32ZeLLY/rSQxAUgZArzZHC+2AfpiJtFrU24sNxWBYAt5+0+kz34C+Z/1j7DJYoeMlJDW5aM5rNJD4YQbf24NMXQ/PoXvyikQzcyCbK2WZY6v3aEQ7NqmEkfq/pyXx+Kd1UUHvMjdAq10IT9ivhwo9zWaII8hiyuH539bDTyuN+zkf6oQJPWlLXGdzOUNbZHWd8etBpZ3gYt/oVjkmZVUCvapQsHSHpoWAGIPck7zQPxS/mXKEGDq8GyS3ncGA6GY92dhNquRlqRbFp76Qu2YT7AVYnHj/ww354oFgL7/XTYdWCcsvFK5GhYmikOmCS9k19DPfBZrPoi+7P99FpyMpASQMKXmaCDCIGsIyHZEHZSBBA== 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:(13230025)(4636009)(136003)(376002)(366004)(39860400002)(396003)(346002)(451199018)(82960400001)(122000001)(38100700002)(83380400001)(86362001)(316002)(54906003)(8936002)(5660300002)(64756008)(66476007)(8676002)(4326008)(110136005)(55016003)(41300700001)(478600001)(38070700005)(107886003)(33656002)(7696005)(76116006)(66946007)(2906002)(71200400001)(66556008)(66446008)(52536014)(9686003)(186003)(6506007)(26005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?G19ul9ScsjEbiVKFgTNhEWcXa1B8?= =?utf-8?q?A3iLhJGXl5WZX4Y6OQl/Gs9BJXaSMgbOliPk++pT2cXfuwdjrjU5vkz9Gh+/xBvMa?= =?utf-8?q?lZPF8bdwMarunyLGKgO3rO8zO6ODgu+4ho8yqMQ+099vHsj7L/22/G02P6oPgJLQ7?= =?utf-8?q?cKGVzduiI3dhkT4mASa/CTwe6gUBssirRe3d5paHWt2MozZ70nQ9egfsAo5bpY1JM?= =?utf-8?q?gQJfalmqcJ2lz7TnaGmf3kFRQl9o5+yVnelHqiruSTXeDNdsFLsLUw7FFoSNpdUIV?= =?utf-8?q?hwfyfdejMmaWF7GiNCj6uaCFZQVP8Rq/FQDdoCstV/PTJiTZhUDam/nhGpIal1FU2?= =?utf-8?q?7/11tyNA4aWmWNWhIe3sFCHDwcsYOaFjhSvLEDsoBe8gMHoqTksYQk5rPldzntj9N?= =?utf-8?q?UT5aEBOGP5vVduZjZLpWtzUvM91iN32Hd5PGeAA31FQ/L59Ch+ViinNwymaO7PWer?= =?utf-8?q?oYpK21pqUsxyswSV+2fKB8mkLFEbK4yE11EeeiqVLxlm4oSq+jvTsYIuzokZgs7bs?= =?utf-8?q?SkxLj/nLKU4k9duj5xuaef8ZSyDdeMPUPTkMQSadQGux4dL3I8sPQgGk2rtT/7235?= =?utf-8?q?TgwnaqBdP3xHTzeGFXurHFIFmsonINE8gq0sWuKMQC8gdB5AH2iQJoRcCK7lAMXuj?= =?utf-8?q?TB79nggXT+LsJrWK0VLYdTwsMxgAEXGEpO5SGYRVJXOFci9cqsWix+p/h31oUWjqv?= =?utf-8?q?MW7zVwheEQWpEELr0BQ2bZCNe/EhxWjzIkmbr+x+Niask2nAOyYPiA2IK/l+Gxek0?= =?utf-8?q?1N7BXf9OJIOcyYRQj6hvZRzLC9kr4iI4pB+f6mNQhAnJavYYfOJiPqpFdUxGN8Vdd?= =?utf-8?q?HtSfnndjG1Yuwyh+zeQdyrJmMmy4InMAAJoQShzu4zK6u0Ma6S7aa8gx2qooU22Ef?= =?utf-8?q?pK+tcdWileRaGKD2api4C6kUhqZl/HHaRlKQ09K/aJymO+XJJwUk0uPwAqNcvmOZ3?= =?utf-8?q?9fX+khLXjPBZtQTLVtq5SyZhnx+UpZK3B6TZCgXy3jYwRT662tWXgvn1ikQrqbKDJ?= =?utf-8?q?KiSy0yiY4NeKVCyyategWt6JAcQ2dwnj1nxcNLQzeYdaozjCQvl1LxBeCffdnkzPH?= =?utf-8?q?/Hqnt49Per4IQgjE7qu7aAneUgrmUXuMdnXgayBPV6a0XNBbTyVi4RdvZzx7/3UgQ?= =?utf-8?q?8cv1htaw7qAxVEcsqtEJsg51ENEtDyLz0RJpR+lnWMTvrm5V/3OA4xplNFQtyQfWT?= =?utf-8?q?smqxjbv7j2tzwHchzczsGy4MjojSLYgxWr64Zi9tPrJ5vzKHWXPWY/bo9qaGPK1M7?= =?utf-8?q?Bp0EIDRzAz8fQ6enoXh0pj9FJK+a0yncd4BqsMfS97NO1HgkgOgcEeonigetYHUPw?= =?utf-8?q?MrerQ6m5Z4USizh/U9OgkoHgnYTJMQdJKzZbFAT54lOLZUPBxL2BKyOcxYxLmliBA?= =?utf-8?q?LbtExJfZZda9L3QODTOoVjlqyuJngs9svLGiVkcT7FVhNS3srYd8T+7cg5cBk0d9/?= =?utf-8?q?vmNW8+h+pZd/xdt4N6GzqnDjB3FC1sfIZ+fEovIotIrA+YFZMI5qCzAUiZuBnZPYQ?= =?utf-8?q?huW37p4JohsF?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Me5jP2Q6J+C7TYbUAMG7bpAt6wqu4KmxSgXppLa9ZwCTZXcmPEvOnfwk8b1Q8GU6ZXRKquKzEi6MOuQ/arUPSZjgBQkhwbT+sjS8w4We5ECOHMjTDCCuLja2YGMlLC80O9yU8RcwqTEA2pQzYe+FPcSCjAVMYWAmPrzk7U/4cgBqGU4vFQkT/rIKmgMgRRUwn68iEZP34G5jpPWglfrAE44y/WKV+DdWaWHlgpPQr4mcleh7+XDrsgsgiGDpvZnLhF9YQNmLeXAVXEK4JBs+9kCkqZD8aBnU4hmgOn6gjcIvXbux+xVGiwM4avBA9LSWpqKyEQZdvajptsHuchexYdXhSCsR3lx8BMRWd+DclO3mrsq9zke+tm4XF56lhSxcXCx4RK/PiclUskS6yh/QDUX9XnvgbEyCbdHFXmEQBf5lC/L1gNQBpySnvHQACt1LZk+wrPWJt47UhP1r9CSbnNaCOvsjD43jDBaiF3wEJkweMhMSgc/eZTMPIJRotkWQeTiC9Ae9DSS0CYJSIdoMLjvKpZROgtsB5JIW/pdf18AfYR/b+0B3aB6GlnolViLtFbVrSIajCVHcdITU0nRkdvKaV2ETIbSNndVrIw9MKzIhvbK6CatHK3HO/P8OHsxBBusy2/kAdAidzAycHl3UL9lIqoSBFEr4cExO38cFyMSt8Ev19xIWtfyinCgzu5nm5BnkL2iAaxwAMutEiw2zmasI+BM0E+4wkyWfb/VJJZX7vReEfB0/35FUGKcKfrwmmuKrjgReKEzqPoYvU7UwigWSRob0sm66SFCX9KKwGlW8olMqe8wqjP9FJXvgk+Upo4tZ9q7cjbrCb5c82qupMw== 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: 60ee57f1-a70a-4c4f-6b30-08db13de1904 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2023 07:34:42.5819 (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: WhCz/g2BFC+txt2urrN2grc7ANMhmN0Vl4TD6QnKz3YFiHbNu/C4zivmQrf+OgQeXYax6LMiKDcrgmY/5fAXiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSAPR04MB4165 X-Proofpoint-ORIG-GUID: pQzcIuFm85-G_ODrNWadcNJBiIB1YTUA X-Proofpoint-GUID: pQzcIuFm85-G_ODrNWadcNJBiIB1YTUA X-Sony-Outbound-GUID: pQzcIuFm85-G_ODrNWadcNJBiIB1YTUA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-21_04,2023-02-20_02,2023-02-09_01 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org When allocating a new cluster, exFAT first allocates from the next cluster of the last cluster of the file. If the last cluster of the file is the last cluster of the volume, allocate from the first cluster. This is a normal case, but the following error log will be printed. It makes users confused, so this commit removes the error log. [1960905.181545] exFAT-fs (sdb1): hint_cluster is invalid (262130) Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu --- fs/exfat/fatent.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c index 65a8c9fb072c..b4ca533acaa9 100644 --- a/fs/exfat/fatent.c +++ b/fs/exfat/fatent.c @@ -342,14 +342,18 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc, } } - /* check cluster validation */ - if (!is_valid_cluster(sbi, hint_clu)) { - exfat_err(sb, "hint_cluster is invalid (%u)", - hint_clu); + if (hint_clu == sbi->num_clusters) { hint_clu = EXFAT_FIRST_CLUSTER; p_chain->flags = ALLOC_FAT_CHAIN; } + /* check cluster validation */ + if (!is_valid_cluster(sbi, hint_clu)) { + exfat_err(sb, "hint_cluster is invalid (%u)", hint_clu); + ret = -EIO; + goto unlock; + } + p_chain->dir = EXFAT_EOF_CLUSTER; while ((new_clu = exfat_find_free_bitmap(sb, hint_clu)) !=