From patchwork Tue Feb 28 06:07:18 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: 13154446 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 D6A3AC64ED6 for ; Tue, 28 Feb 2023 06:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229591AbjB1G5R (ORCPT ); Tue, 28 Feb 2023 01:57:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbjB1G5Q (ORCPT ); Tue, 28 Feb 2023 01:57:16 -0500 X-Greylist: delayed 2951 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 27 Feb 2023 22:56:45 PST Received: from mx07-001d1705.pphosted.com (mx07-001d1705.pphosted.com [185.132.183.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 969792448F for ; Mon, 27 Feb 2023 22:56:45 -0800 (PST) Received: from pps.filterd (m0209328.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31S4RQ2l023589; Tue, 28 Feb 2023 06:07:24 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 : content-transfer-encoding; s=S1; bh=BNyl0x73b6wVgZwRcK+kG8YClNy0xeSFgcEU9B48xJI=; b=CzKyoE9vKHIU4dWYTho77t7nPxLob2bfkwWQMExB2FnQ3MTM6/F0fXf8C2jQrul0gVmR UaDXKi1Tq+1JKRRxywqiYdPyhzqVwxQiBjPl/OuUj8QOFd1wilJvPk8SHyoNONTGkMd0 SKFBaZzTmFaDwlSZNdZ/YQ7+848V7Yv3w9QKwrR8LJHivajpemfOdMqow2dMt4uY2Ak9 ipmfOjP6DMsPLJdb+hNGGzm83BQEC1a84qxnYPY11yD6ACBmZgzaq6ratQQQAjSTEKSF VSjdLLujfxKHQffju2VrmzGnJ4T170inMH/gyyH4Bfqgp33wODMk3GWour7Sux552n2Y lQ== Received: from apc01-sg2-obe.outbound.protection.outlook.com (mail-sgaapc01lp2107.outbound.protection.outlook.com [104.47.26.107]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3nybgnab7h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Feb 2023 06:07:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=itc/3ZLGhVOCcUgZFMOVLPyhmTMGEWEWWHiktshycg4hDxzX3QOcnKcU+Nx8sMrNL/U9EHO8CBU/i2Xqg3sVIjmFpD2Qb4W+OTM6ekyvhsrKRDSePGHY9lRV0OZB5PDFRvHnhECrYSXwewj50KsQ0FSpOTS7AA6gTTXqc/HdlaU78vuE5ppfc9h4KyXxqzqi1nDx3qtMOBu1I6AzLSAe1gIY343y3agz/jHneV9vZ7Fotx4XYsHunh5O1aYTNWqL9zorGvfOCGODey7OTTLcy834fncnLxdKMwaeigA98gX7uul1DKpJNtX5JcFjQqM1Ix/N36HmqjMVdXHVbxnQdQ== 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=BNyl0x73b6wVgZwRcK+kG8YClNy0xeSFgcEU9B48xJI=; b=kbb5z8syWzd8odJoGScqrgvToeIqsJkdTR0a8J57/7DNBreokQZ5Wfg7WcJhRCFbYcYJCAK/BkCdh8V+t2jB7hSOJxC/LaTgu9nVAAcOujjp6N9uZRYksk1bQpELThI96gozotWKLcROGWfCIkxbdFXs5PmmN4y4RcyhkWpoVX0dcOLn3SFup3HYKZBd4CAZeoTdc0BSm27TOrkRs5ActDi2hojKjtS7NFsQcPyuv9/oLIhFgBj/dfjdJcQEWexo5qOvXa28Z8GKbnMmxxyUdfr+VZroFiBd56+TCpM9+PgFExShq8oBFK8kBUzcsk3og0oCNOQg+q33cRVn62Vn7w== 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 KL1PR0401MB4227.apcprd04.prod.outlook.com (2603:1096:820:25::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Tue, 28 Feb 2023 06:07:18 +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.6134.026; Tue, 28 Feb 2023 06:07:18 +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 v2 1/3] exfat: remove unneeded code from exfat_alloc_cluster() Thread-Topic: [PATCH v2 1/3] exfat: remove unneeded code from exfat_alloc_cluster() Thread-Index: AdlLOnYM/msEcfBIQmWIdYvNavIEWQ== Date: Tue, 28 Feb 2023 06:07:18 +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_|KL1PR0401MB4227:EE_ x-ms-office365-filtering-correlation-id: e2bdda73-94f4-4515-8929-08db19520bf0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7ywCnNHknJTdtFA64HxuLTqMIUdn27vKMhPttydFZWvXJRvkxOnNg6wAMIq6O0Gb4+bvPftUSvLKjIt68fgcqMihGOxyiluNu8wotwbH4lorpx1wMqk4zJ6Ef0nsr1QSrZLHEkjzGYVfddzihPF+3mV9+ruRczJh7mJbRfwaKklcUGSexTDRnItFNcEMfAg3kEIZ7rpjN0RMN4+oVNkJFNDPi6FX/HemkSOj8t6l/tWlzo+kS3b9RjMSgkrrLaQwcUA4fbGQ25sCQnUmC4KB9g1/ncZ/PcW7AC4ml0rM0BPn+UH93LoK/YssMA0OYrmmuKGpf7vc9vXQELMzh9IG2q4OM6walfNFSUT0b2ZUSXvW1xe/iPefql9nFKnP4Finszrox/DnbPqy2eiMzZW/v1I0hFJgH/SCoKp54VAgu9nSlwUhl1uNu15lWtuxHXYfZyKzwTP59/U1BOgptWZyR4YbztFtxTuGux813a6AmEUeLzRhgOb0E/bgd42ADsoEe/L581NIbyVEm0GYBVnHWvlgVDWj3x/zqTSEWLTYGnJFEpKDMC6OW45R81c/cos0rsC8ZaimaWUeaeaWl47ucEMtxIqjq1LhGeiP+RDzXUXqISGBdG+M0q6aMTreHN6GTQebPlEpt8Tt6QMajU0cZQ0F+h9BBCYTzzjcm7lKcs4HvNdYplzn/xIVmXofp4cg 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)(346002)(376002)(366004)(136003)(39860400002)(396003)(451199018)(110136005)(83380400001)(33656002)(54906003)(316002)(478600001)(82960400001)(38070700005)(122000001)(7696005)(26005)(41300700001)(9686003)(186003)(71200400001)(6506007)(107886003)(5660300002)(4744005)(38100700002)(76116006)(52536014)(86362001)(8936002)(2906002)(66946007)(8676002)(66476007)(66446008)(66556008)(4326008)(55016003)(64756008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?0H93ggAhm/RAxd+7Qh20rSKHHTcc?= =?utf-8?q?WlS3+zPcd8bhcTWv9mo4iDFj8UBpQVZnl8rkp1nBFdUjP2pvPKL8/jCGVtkKEmbiB?= =?utf-8?q?6wv14JtMnD8a7jpNZZbsXVbSlvAcZ43Xv1my8spE876mJwuPirnYLH5ksc41N15+V?= =?utf-8?q?JOx9hFvxtcMHauQXP7RP0Q31ZU5UFALjLOta8nKDw0U7HIxWgw7T/o0CVgPCdAzo2?= =?utf-8?q?km8tvCH2JQS2rzzdWcemd0aRT/H0XPH3qG8U0vZOrLlGLGcc/DFrq3Y0i7uO1f4Hw?= =?utf-8?q?17RR4OtE+3UkRpqqKv38qb9Y4//gAOC1wdt3xpeQieuDNputV6tw8EwdQXzSP9L1U?= =?utf-8?q?D1hZ/Bkcl6YZrWGDjmV8NgsSCnR/dlCn8EhmdZHHdanv0u5rpGsWQkMl1bnpVJddj?= =?utf-8?q?T6vJqMX/h/w4eXsm2XiMzZAEUUpMgtfYxh3SNF6VrmuItucS4QI9cEcQmtUHe23d3?= =?utf-8?q?ZR007EVndxUO80jt4nou1HPWR4UqtJsuojmx8mOqcXuc78JpZtKpFqSnj9qNCP/s8?= =?utf-8?q?VcUaDBLCc0TNYd+rSCbx0JZKjV5QiRagrVvNMn0SegIzWp9pG5Iri04/OWJwg8MWa?= =?utf-8?q?5gZnHVL+14/8l2CpAD9geBHaqS2dJ3EwyTZRIgaSTvuX66NQSek/vJWwFuepbIlHc?= =?utf-8?q?A/NCmPH/GTZ0gxEXyV15eDkUXSwBf76/5p3QLo6p0LxpefyqN9kHDth0pK/ZE3246?= =?utf-8?q?oYIUYowT/iD2jgFkguJXZIDC6bwCya2P8YlsziLwISAJwAaVnnH27kBCbScyw+pSb?= =?utf-8?q?MuqF0W2QKSZLDWX2a0yya0DnSLfFDN2lYM2dy209ic1Hlj7lbqmbuXtkAj0Zq1kOI?= =?utf-8?q?MUUb+/R0kGnQJB24Cc3Ve0ya9ZejNhgQiLGSJIb62ITdwKl727Z6/9AWKhvMPcsgs?= =?utf-8?q?JETurqatbKRDE6db3SF3VYTRolmLgqDY4xxpSMfehG/GpqfQ8ZQYVMCPhzHJhcnmp?= =?utf-8?q?XaX9lvBtkhcPuadqveUJD/ABP+4N11dYI1aparFtItcGuWGa2f2J2HstOQSiibaRN?= =?utf-8?q?OCY5U5MS4VgSorf7XR9Z+hD5Pu/W8Xe+/pJA0fWvhyMBfpDsuYwPeGGAVqP26pALj?= =?utf-8?q?WicJ0ZSak/NPFbZekAST6YFYmoKjsi8nW4o4ETMCBljYruYOR6SM5PiCmFbL7Fpcf?= =?utf-8?q?yJzOFAav46HCzJITXIE+xRnM3lMm4iVf0JSIJ2qIm1ZJ2SdmVceWtfVbDS6M2lxTK?= =?utf-8?q?RpYXfn5xhNbOwP9qYszWGqzP51VsqSOIFYkldA4ElPzxzzkT+dB2U6bV1c8UIMmBT?= =?utf-8?q?gn/aRLfhKBmnzGY4Vo9HA8cegRl5SqXi0bsWwT3+kuCwgsNivKWk2NaLRYgrnaFWj?= =?utf-8?q?H58HXd83VGl6umAhro411m/elsfkJCUV/+3obwMuTr46KZ/5UYY6Fr5S+Za61VIEB?= =?utf-8?q?4vT1I054VFsloCGOqLCD4J5h0sGVMW4vAQKXlPoqJu19bbFdQWIpLkc7qZJmeinRM?= =?utf-8?q?kbSkJa3zu/L9GwOK1lS8nprPE66DxtB9RCT827zJRKOKJvz7R31AtIU2aY3VaIMtF?= =?utf-8?q?a38RKO/phm05?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 4BMGJYaFgd01c32iu5/EGDJ1ERQ7ntZXW1aKid1a85YAGNKrAva/kvO1FbWmagj735kweDes6HZBoa5lYYXE72i9+ULbGrhTSe75Z/ajwQVlRhh0cTjeKKt/fkpY7HyIM1ut+U33/Jbqm825p6Sh5mQJkfM9Pca2AOM/hYOgEarFG01RJo1EyN3FyLrfAWsD3NS+OpI36w1OR/L0ywENqPM1jZt43zNOmNf0o+1Liy+/MpZ/MK0oeGRZG4A53WkzExPuUTw0CDLYIDfxHNNTSkEiws1PfSq6os4FBq1NbVPerlMmpFAnoUktDO6V4+pDrP50fmgd6Kz+41m+hbVF5FBKOm5w8fRT2g/ELDRyKKmduOLIAGxDbPJQbzC+Yh7HqTCPRy9cxqU/zxIqZU3EnSE2zLM3A5X1rLTBUtY42xuKvd0iGcndcy8/3iH6VCxdsaoYlnYJD58a7IJKQtwLiDGg/OQvsH4ZEJ4dpmMCJqRoTWDVyu+r1oTa63vXAsE8YV+h+7VnqGsz7GiOzeucrkSRsx3goP/sLND1blP2vS0JwDCKUSSD38QYXYlfxS6y4Ur5lfpksBIarLj4NKa7UnoREuiAtH8fs8xjbKUQILf1fE5pOUS0l1tmYo7k16xPnTZ7hGBmpXbn8bMVqXzRcqbDdrVvU+0jJ1u9N4OrOyMMkFIEP6nqOcM4PBDSmG5KAzNu/zA1WQg+f/dZJnZONaI72n/yOGezEEX3A/ixMz+HVCB4JP0yOjGCRgOGrcVhsgF6aBu9oSZp5vsURNPFi9xL/ERYy3BJNsQIrS4Hs2BzSCrqDvtMBlAtuc5mNBCK19ju9iO0DxRcZKbQX5D1yA== 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: e2bdda73-94f4-4515-8929-08db19520bf0 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Feb 2023 06:07:18.1070 (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: 5qp9XsqFbN5uiFyTLjAfuJ1Yd4Rd+08tSWg0VBqgVTMY7uc5rImj4A1Ow+zTSOU1QIbK3qJC3ly3aC4oysVs8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0401MB4227 X-Proofpoint-ORIG-GUID: F5rL8jtTRCBcjhDas_eGF06qNBzERe4y X-Proofpoint-GUID: F5rL8jtTRCBcjhDas_eGF06qNBzERe4y X-Sony-Outbound-GUID: F5rL8jtTRCBcjhDas_eGF06qNBzERe4y 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-28_02,2023-02-27_01,2023-02-09_01 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org In the removed code, num_clusters is 0, nothing is done in exfat_chain_cont_cluster(), so it is unneeded, remove it. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu --- fs/exfat/fatent.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c index 41ae4cce1f42..65a8c9fb072c 100644 --- a/fs/exfat/fatent.c +++ b/fs/exfat/fatent.c @@ -347,14 +347,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc, exfat_err(sb, "hint_cluster is invalid (%u)", hint_clu); hint_clu = EXFAT_FIRST_CLUSTER; - if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { - if (exfat_chain_cont_cluster(sb, p_chain->dir, - num_clusters)) { - ret = -EIO; - goto unlock; - } - p_chain->flags = ALLOC_FAT_CHAIN; - } + p_chain->flags = ALLOC_FAT_CHAIN; } p_chain->dir = EXFAT_EOF_CLUSTER; From patchwork Tue Feb 28 06:07:26 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: 13154490 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 172D4C64EC7 for ; Tue, 28 Feb 2023 07:43:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230260AbjB1Hn0 (ORCPT ); Tue, 28 Feb 2023 02:43:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbjB1HnY (ORCPT ); Tue, 28 Feb 2023 02:43:24 -0500 Received: from mx07-001d1705.pphosted.com (mx07-001d1705.pphosted.com [185.132.183.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8A311205C for ; Mon, 27 Feb 2023 23:43:23 -0800 (PST) Received: from pps.filterd (m0209329.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31RNQfOt019754; Tue, 28 Feb 2023 06:07:31 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 : content-transfer-encoding; s=S1; bh=7SASak8AQibfHLq3frEe3qrgYuIPfwZQv17OFq3iDYc=; b=iseVjyhbmyWrQTx7OQfDpeAEtEGHPYjAzcTq1U/pZSb7yFUhwp/pX6RjE3eGYxRN1bmE NOVkUuY1C4pMrlhB4Xd0IgIC3EJwM00L4FqycgJ7cO6zE/huw7+OSghdKkBxULt3dYQK lCapwPtwQ9a7LoKLWuYdz1g1QRM0CuJL2E29SE/wjGBgENV+xNOI+vhGXgE6giSkpcJ5 Mm7b1tYgpKLBXQD36OXF88dz1U4VZL9zPGzm0M5oYa+AWajany4wCG+4WsO8z0GUay9T F522tLMjCK666P+lTuQNJpTTJGl0xy58r44YMGant58bvEVGWKvA8aWuJJUuGQ+IOdmh cA== Received: from apc01-sg2-obe.outbound.protection.outlook.com (mail-sgaapc01lp2106.outbound.protection.outlook.com [104.47.26.106]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3nyb2p2bh8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Feb 2023 06:07:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gy9SgvKjTpd5ZQhGsmQ6d4MNXeUoF3C41PWckRqLtOwGwyAcLsAgXaqhw4H2Db/ihMsk9h4pyWNDHFrKUg2ELiD6VZ44yCYRMoqnxn6S9HUT9iI5aeq8V9kt0M1WlsS/K4wxzPSzhdddjtAyoDphQi+h3l70iCxFxxFjqEYj+P0rUADRNiAMbPYlfuEi+T6JAIcKhbzH788VS4q4BJZBE+irrZm66V27k04Upe34us5FN11qkedckA0Nv1HF18H+B9ck69oP2Uqvi7nhulAn+lLYYuFArnIlDW2yFWzgvYYliva6W/Rg2OURn2Sd37rUs1YCHUHre4nLVGYJl8VvDA== 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=7SASak8AQibfHLq3frEe3qrgYuIPfwZQv17OFq3iDYc=; b=btpIgl9xC3nUwN1c96eBWcR/r3tKJ18pdLdbYVe+CuPwZ6Z+6qxRykU9M792x/O1dXm+Azvz9i2d8M0wqVD06jJmvq0zcyQrhYbzGBdZ1rwqF4dmdi5/mF/1vSc3AsJCooON17JXOOjLJqxdzjmC4Y0wiPc7G1qfTKsylKDMOBohDNHfpfFFqXSMOBx4wKuoCq/ph1lk21c70Uet2Dx7/75e7m4IkgnDiRh+455oXrYVxTH2Cx6JQoXfVVdfoOogyRD6DYXBsbbELBNMli9phnLmIROnGqKjWBjmqdYe0OwIWJmHzxSqhkWe6oAKhnlRl7TXmMCBlcz9ACCEStgA/g== 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 KL1PR0401MB4227.apcprd04.prod.outlook.com (2603:1096:820:25::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Tue, 28 Feb 2023 06:07:26 +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.6134.026; Tue, 28 Feb 2023 06:07:26 +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 v2 2/3] exfat: don't print error log in normal case Thread-Topic: [PATCH v2 2/3] exfat: don't print error log in normal case Thread-Index: AdlLOpvFm4O2ert5RiWDsj4rGy5rJg== Date: Tue, 28 Feb 2023 06:07:26 +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_|KL1PR0401MB4227:EE_ x-ms-office365-filtering-correlation-id: 9444fb74-333c-4feb-e828-08db195210d6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4aD6OmdsWgTINjP5mcpxSZmC337hL3wnQkZvRPWx2COZxfozKUfQoR8K6MHt0nW9xsfKRqpoxwK/J/geHVaN+IYy5YJduRyxmqrvPXk8MYm1T/IXvPCY4zEynPEnW0NZ29G2GpciwH06jetHMk1mquiSlafBfa22mCULoxLQu0p+QFXT5eVHJX8YXXWcLxAcOYhm5A8Ja3ylmc0Y/MfLWG5LykA5NLR6cuZ+IrHgRE5TWeOS+QmCNXXkmWeFm0FzqOlZlxFmrm/F0ZUI2EeBUvp4Nvhr7Gjvl9JczdWBIfcq4U544oMDaOsHA2Pl8MHGT6y+L2Ba1DkhPafAeskTbXmnyPIzYAh529H8ttCtxLn8nWQELYA3YEX5rhABZy0gmbuDcx8TPiIyKmu5i58ytGg/Z8IPG5mhQGZaQt23xMZUztsEaP2mUIl7A+1BOYU+fbjw6lhPVSy7q+A1glWmEt53JajiF9SaM8US+3amW94VNllmIWj02qCOyna99bgdfb9zhwS3J5Gmd91FsE9+BvDe2E1TTI1WCfJls21vsypUTC5Z0xI4r3YWFImqIB+mkGtYjhQ/tA/UR/sDrb7Lpi6rEGSxYPZt6YTL2Z6y9bQ4gLsj3/P9l/6mfMQDokG1OmR9hg/TYP8p3R2zA3z0HHWrBRq111Mid7q+T2CFc1yjchn/ygTUtK3fZB00A+mdIed84NkqfvHa1skLGkHw7Q== 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)(346002)(376002)(366004)(136003)(39860400002)(396003)(451199018)(110136005)(83380400001)(33656002)(54906003)(316002)(478600001)(82960400001)(38070700005)(122000001)(7696005)(26005)(41300700001)(9686003)(186003)(71200400001)(6506007)(107886003)(5660300002)(38100700002)(76116006)(52536014)(86362001)(8936002)(2906002)(66946007)(8676002)(66476007)(66446008)(66556008)(4326008)(55016003)(64756008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?EfVKu5BGQk6q688OBuyj9K9yQgqE?= =?utf-8?q?XkV6MImYpMl8BeM6jhUox42jSfjnWfCdo80Zy24q7fhOZ8oTDLg18xltomrmKqM/t?= =?utf-8?q?2ydT127S9ZBzhA0tjPGKdBTTZHAXLbE1m0KtdpQlnxeD1AGAUoETueDmxJOvdjhyT?= =?utf-8?q?AmhOuZJeo13+BIk52YyYb5FRLdNGlKH/2jR5UcH16pPOMwt0V5ddqATVaezVTU46k?= =?utf-8?q?5QjG40wIH8rVvgU/EIBATnAy4uKAEAbtFkeVaBJE4fdZNpzJL+huEdX+jDlBudTqp?= =?utf-8?q?Pg9SN+rp/eLTu9k6NlkQ9DWJiOSO4pnDYaMwp5nxPPm5nuiP9qNVpulhDpJ3pGQhN?= =?utf-8?q?m3pk1ge3NOACDeKLKQKDxCRIKC5mow5VFUzNDxywQ1bQpNDPJtlb/jGrawQVtgNaJ?= =?utf-8?q?o6S2rb41PibLADLESTI4OuPlfpsVc5O7oMDC4vTzKy7J7EONaKACi++uCbP52uFts?= =?utf-8?q?CMFUTO4B2LkWRS+Or7O1ZN4lRU+CEGh5g80ycTcJTmCZlgcULTv0Tfw1AVBIFyZI6?= =?utf-8?q?jyRHDuVsSUltDSdfgMB0YsCcQ6K4nMNpSyk+CP8MBBnnbQdoeqoIMRShlOLhObLx1?= =?utf-8?q?2L8PZlyDMVAp/PQx7Eyp9/CPIm8ivdMJ37TV7hPi9jCElMXdqxqb/LdKpEfAXujhx?= =?utf-8?q?3izPU6z5PynLkE4jMVHWTsP0Tiu4wGsSEaySaDHriwGyn69U8eOuIpm3t+ucHJthh?= =?utf-8?q?JENquF198+8Fyf0aBS6mdI0vhn5uRdobBIahJwiprC/CuUFbAI48dwsxAx6TbL8Bm?= =?utf-8?q?iuLKN3I8dhbYusZMBzRc+91UOH07O02GpxPrPTfh7NkG0OLMcS7GBa0JnmopMqaxd?= =?utf-8?q?9sO671+AXxwa3OcbkhGpjeRjAdmqzaY7fPpdRpGSmXau1oy1uopRYPm0OaDBWdwV3?= =?utf-8?q?4e3ImQLgbhb9+/2nGOC+rrxIBNBVycoySieH3KiZ7uNiDFv8QdlF8hSHBA38yLCgn?= =?utf-8?q?U53ACa3x7UcuPPfcc4kQcS3sh8+m25eqVrgSuM8dOZ+HSa7WCTHKy0tJQbkfQ4cPU?= =?utf-8?q?n8zZQ884s9vfv74eaEwm1gyLwe1zJcMmP/cgR8ipq2l+tCVW04SohUFvTb4h2FE3N?= =?utf-8?q?S0+X9uGGJBgcSRX0sycwpC6nsM3z7MYHAA5dgambRWKeQdmRM0GTai6t2GYBcWBin?= =?utf-8?q?S1fcQsCFFksuPt02PFbgt2N2SifJsknf2OuNzUDBIuupWL/whMAwb1a1qsjeD8pY2?= =?utf-8?q?i1Bz6rIt6Tf/dyH+QK8BkjErWsyKRqYazndv4gqteccEnkDQP9DBXV8lUMhkM5Ojb?= =?utf-8?q?vRLIviiajImn4JoKtRN1hc2KQ2zuKDf0GY52XJMs82feDxcSiX/ZLGJ9nqow2EhQ1?= =?utf-8?q?sXarBCzintuX3QyhvlvZwCsOo1DUuzKrm/lp66fRKzZSCP+rD2G3/yXeoJB0TZy0+?= =?utf-8?q?WEa3iO05OGiH3H2BasaM5hauLShAgB8hGvqqUwgBSmi9QDG3jUvCOYxcRoO1Q0Hfa?= =?utf-8?q?9d+GcdlxiXAUyZLV73K70vccdz4fxdutZlvl3u69HQBOxiJaTeWnzYqySBBX+WO6U?= =?utf-8?q?djYM+seO4bFI?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: izCwWFJP7TD1cYdStnsKn1+UECVXak3nBg4WXNP0lR+N3McHQMCl0YVjrHtL59ux5K69rkeL9pX5CkgWZj76TrIF9CnG8f4TJP7QIg/Fuazfd3F8B1tIyuJ6H7PmeA/ItamntJ0tnz4tdOVn0cY/Q/lMRZGioIqzwsEYWnOJrpSyW8ZNN5Vb8sUrwwQWmgmY6l5aGkiLds6CjJ+1qhHtq2U1W6LaEMnqbhDZyk9xl1X1//pdK5GiZCL76QKO655f34+uXwXse/VvHIdGAJ145a667qWrs9c8Bdai0+QEAIIalVNmQHfmnTNF6ErGiXzEtsFphvHi5ZsBMWO49ylksN8LQqj2X/poKvgd7P2pwrufl2mO6AhjVHPYWpUga23Ru6Yfr0qTC0xknR37q5tMZhUADR+XQ3qzN2QJfmUP2t45duEh8uWWlG6C/zweopMnJfV9TFGfjbHM57riRKt1t1BnZqlX2pRnkF/jCqBYW8nEcmd7nRCIM/5VGFPW/0zex3Bomq8d4Ypm4N0s/OeuBb407xF5746+mdgstA/+c4sHwoXkrViZBGJ82t74KdZ+seHVVi0yWtP2mwa3m2gGxtEmkFiyAnHdj1j73BiwEjFm2EW9U2E6VebDu5vb3jBFzrtaHuyRzZgknSyFAJRoCWXBO+BhM93SMpZ6VJxBhR3c+7wtxdCM2YPQ7RlZZCERXi/8una3OZklfuQr17vxEUYmHF4dj7QVO9nc0zFGYkTbpc/P1iy6sNFjAI2t2t3oOWbkqxRurG7kKA8skWYnLRo9NazVoVEb8Lp3WYjn6ZsslhIOd2qhjeyoC1H4yqeM6NLvsGtAGVfw42LeVH6Uqg== 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: 9444fb74-333c-4feb-e828-08db195210d6 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Feb 2023 06:07:26.3277 (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: aOWkw7R/sDxzDIb/BvrOumHeYyCzgwEj4ddRkzEp+Xl31RlrKeStt67EuQLOERN4rxG8yUx7yXRAT8jRt3a2Bw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0401MB4227 X-Proofpoint-ORIG-GUID: 12jKhBPpoKCudEdDioMSgBFVQG6c446k X-Proofpoint-GUID: 12jKhBPpoKCudEdDioMSgBFVQG6c446k X-Sony-Outbound-GUID: 12jKhBPpoKCudEdDioMSgBFVQG6c446k 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-28_02,2023-02-27_01,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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c index 65a8c9fb072c..c75c5a2cad42 100644 --- a/fs/exfat/fatent.c +++ b/fs/exfat/fatent.c @@ -344,8 +344,9 @@ 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) + exfat_err(sb, "hint_cluster is invalid (%u), rewind to the first cluster", + hint_clu); hint_clu = EXFAT_FIRST_CLUSTER; p_chain->flags = ALLOC_FAT_CHAIN; } From patchwork Tue Feb 28 06:07:34 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: 13154423 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 03ACDC64EC7 for ; Tue, 28 Feb 2023 06:07:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbjB1GH5 (ORCPT ); Tue, 28 Feb 2023 01:07:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbjB1GHz (ORCPT ); Tue, 28 Feb 2023 01:07:55 -0500 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 782CA10DE for ; Mon, 27 Feb 2023 22:07:51 -0800 (PST) Received: from pps.filterd (m0209318.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31S5nE90023203; Tue, 28 Feb 2023 06:07:41 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 : content-transfer-encoding; s=S1; bh=ynUN1zb79v0/N5HHc++2qYWCOw1XZFH+0Ow8bd/VPRI=; b=G+iXoeKQSGdFzSmWmmBJiDmSVw1fc/kyeDRAYK1e47/oalcyLPQvk7ARcyqLjYQkFrkN rS58aDwo+LRQ+/VqBVYNz0oRUGEadAYVRAl5i0ad4uhFUIfueKE8hZ5D3xpAN58nRKgV n7nf7uTx4OXCGBibmIsBPnGh9GrseCVv98hSG7bL7BN7OGZB6drByxgZz9PgA5/zq1jv SpiTOTFIaj74TNxjzab7DECovQ09pMKlgoIq6VKKCXfkpVjZwdwxSpgqOVeO8TYSo9ee qV/izhlGpxoeFPY9nR17RjOeBDSKs8Qs7hLFmnCMiPHGXJUVsikQPi1C9j1cV6BwlMVJ jQ== Received: from apc01-sg2-obe.outbound.protection.outlook.com (mail-sgaapc01lp2107.outbound.protection.outlook.com [104.47.26.107]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3nyb2gab0d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Feb 2023 06:07:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jqh2nm4LHIXzCoCLv9Ceo5OhzYdVdGxOsmoBNyHwVzab/N1KnSdJYPzfb9P0I8xu2jjSx6cusXWhEOOVpfZUTMlU2G1zXd0mSWR/OkC5RntC91BwU39fBCJzyFaedf+cBYFl2FGL6P2dg3YpCGXKvdNdVEoGbRTqvbU3eaMMTbIBitAHLkj6d+tjVJwGFXKs5yLIXjzEOznE2TWv8sTGkkECFvizhOm/YnGqKGDtNaIf3htX49dtPr6vC2O4LjYEitC8saB1FhRUboU6xIzIG/vKt8mB1qxjTFYdqcRsmozMefPTK4knXB2sTJsEInureq4QXpsA8QYX+Pj/3snGKA== 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=ynUN1zb79v0/N5HHc++2qYWCOw1XZFH+0Ow8bd/VPRI=; b=kHdv5uB5h+U0Dcl7HwYGrt53ZEK4RzZqpAGRmiR/8LwpwIiolVGBGBcNsT1+DGbZ4UYRM2ohuZfa1Qsg54sAC7Reab56lfki4O7r/A6Kh9RPRCrgwnO2Dv8acRIdOHX9ZX8xhvAMIoBlGDTPhHMv4V+Pqvu2SkP6jUVYptvmicsoToWTVSQfh85AP//SzmwgJQiXP8o1/161HDHaRKXv+hV73NIa8zfbHM1f43Xb9f8hns6dZlCaghLsCzLzbGvbLbgeeZ2nYLB7RzM+gzQh+s5k4KaJZt+OiljmUJQLs6pjulQUeDdgKjUBgUoG4Mc6mMYgsbGsmFNfsZDyByv+Yw== 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 KL1PR0401MB4227.apcprd04.prod.outlook.com (2603:1096:820:25::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Tue, 28 Feb 2023 06:07:34 +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.6134.026; Tue, 28 Feb 2023 06:07:34 +0000 From: "Yuezhang.Mo@sony.com" To: "linkinjeon@kernel.org" , "sj1557.seo@samsung.com" CC: "linux-fsdevel@vger.kernel.org" , "Wataru.Aoyama@sony.com" , "Andy.Wu@sony.com" Subject: [PATCH v2 3/3] exfat: fix the newly allocated clusters are not freed in error handling Thread-Topic: [PATCH v2 3/3] exfat: fix the newly allocated clusters are not freed in error handling Thread-Index: AdlLOtELsgz4S+exRGWgndVxY+MD7A== Date: Tue, 28 Feb 2023 06:07:34 +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_|KL1PR0401MB4227:EE_ x-ms-office365-filtering-correlation-id: 40fdee2e-acc7-4cfe-bb7b-08db19521581 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: w1Twxk0j+exicYgheyhnvh/Lc90OuFdVsndxzuSmF3NJbrb6qBdkNTepE9/CDLYhjD7fVHJnexVIojuBznwyRqXTGvFW2bGzboaRUXSnvjfhxfbrjwCvXYUgLqbDmDRthg1whs6x6Bu3t6d1b6yj7i/kvatV4LyYjV+6WeLyNemE/VD6I2WGBo2S3M+dG3kxsrMmZMD76ke0m8/nj/YmYNbu8K3G61JT5YPn0nY5m+K8ktV4aCY4K8Uk5BpXtUYB5nmdOOnlcKTh9yZ46YgBAHB3a9TZueUs6HInFZ6whaaUO/ZiYjZM00rleOSdgjAHfJupOemzEXXTzdvUx9CwTv5TdZjUvNGb65vc+8O83sww6TtB5j4wIvvEmtPsF6tDF/4hq1ljgQ3EXUBvbgG/CUaq6gWm9/QE6GtM+r4p4txgqEsfnRhmJ9dIx9Lz3431JV1xgpSpYF5Gyy6lxzBChQ8Q9MHs0MgLq4/K+A3274E3Amq18jD6X3JgBLQ76sb79nRs0ELsOcToqtyfjLEn5KJTnecu5/eA/jPat8UTRB+qzyy783241SYcqAA2ntdYdgyE1v26g8ZkSPy4zWuSS0xjBfwT7Nr1MSlYs1xLeV1+LGQWDRcT91z0mNETeqRMpbS8HPTRlDreGtLhWNALDaLiPVh88fSNvdZ4SHcX5giFzxeq9heZzbl65Tay59C8C7hocnl2uJiBh9KImM5CWA== 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)(346002)(376002)(366004)(136003)(39860400002)(396003)(451199018)(110136005)(83380400001)(33656002)(54906003)(316002)(478600001)(82960400001)(38070700005)(122000001)(7696005)(26005)(41300700001)(9686003)(186003)(71200400001)(6506007)(107886003)(5660300002)(38100700002)(76116006)(52536014)(86362001)(8936002)(2906002)(66946007)(8676002)(66476007)(66446008)(66556008)(4326008)(55016003)(64756008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?K3KwtzZ54zvzVbRujx/9thTwwtfq?= =?utf-8?q?GpL48bgIj4ugFkJLNH7LxeRrcb46E9wEGge633hTSEDorvM2GJbcK0xKlg8lr4z0F?= =?utf-8?q?exVj/NTVFFoCSXsC1zKHFoAehYbhjFL5iQmBUBn+AZm9ejQpRUGFlpa+5sfrsqX3h?= =?utf-8?q?Bg52zB4eOKCU3GMEiK16KrSGpLITjrkLWzX4vCpKloxkuXND4KreAkgAyTRC2g74P?= =?utf-8?q?nT7Kp3mUH8JKrSivs0qJVo+COZmG0NnNWh5mKCSWhJINnEMiHdwo1iUDHEY2xEFu1?= =?utf-8?q?IPUYxbWPb85AiXuuSzvffXApkaiAg8DjALq8hyubmlSUWpCIXFTZaLnHtRVI8qmm/?= =?utf-8?q?zW3tcN1sXyayUQuffENUQ0z4NSJy13p2bJ1mjowQqRmVxLyqzQvbyG2lhp5jkRdTE?= =?utf-8?q?kPCdUZrWEBlnxJZxvNnTCSuKWa7kpyGvIrj3JJ8lquhCZhoS/QFJ5MrsNvXAYPJR9?= =?utf-8?q?n7SrPNYSXB8Kogj2l7UOQ/2my23qwrgwawtGR8c+cvJnuIHLKCBq/Y6PKg4OPEv83?= =?utf-8?q?VDTn8o2npioEbzUiXugERj9h3M82CFJMxcQUBGRWrc6DTl0P8bvuZ5JOQuVTOSLx6?= =?utf-8?q?R7ScyFKOLU1nKjXM5YZhR+OM8ZcNxuQJzRcPhbdePgqw7NfgkoEIzkcOm50lohbPz?= =?utf-8?q?dorxbnWOTptSOrwamJbUIRXJFNTw1P4xWqEFet5Udt/vtreoBJY7Ur9GAM4e/9nfG?= =?utf-8?q?5EbDA5p/3b4lwDxy9APhnTHZ5bReibUAJgGFddUBMOmxKYsAGaF5u+/a1cEipD0Vj?= =?utf-8?q?SpnvrMEZlW9RJkCiHWF3i/focExauhx85T+sRfLhRpIZv3qR1B8gHIHlp4GZTUW+2?= =?utf-8?q?beV6PHaDiVoqrjf9lkWt4iXsE1N/hbUNxktoujoeFJeX0Sjo1VIQI2/yFYutOSHyk?= =?utf-8?q?heDBaNSihcOWFlScGlsqQWxaSmOlwuBCM8oCObyJzjIQ4WihIcwotGx0ItcTszuOz?= =?utf-8?q?M8wLKBmLfbQBLWoInjj8XL4da/laAfvH3Iwbf/QFf+Pxmk17ZZdHemYkkH8Er8kbL?= =?utf-8?q?yHoQHOpaRpuN1laxDOd7J31AOC8R9nl1vKYNgnr59SGhH7x50O33T3rCF7/gdjYZy?= =?utf-8?q?y+jOQqmnPuc9FROZY52qTEMQeHNsdBk8CvpbUkWzQwQmTwV/MSaMj+Vkm2Vtx3YUQ?= =?utf-8?q?1BCVIYhYlrUhCnG50RpdJKTuzXpk9kcdIrTeyquzXsXQbXsudVzvzModNVt1YnHfi?= =?utf-8?q?yKZGugII9mYw5R6kJgCvGKzDMsxd2UCQdDdHC/hyYyHaTYzBlOpqY8yFy7XDVijr8?= =?utf-8?q?Z9VfBvghmxXY3GzwiLJAFHl3MF1HYxY+M+yhmow9z2m3Vw3UWZnr1GJb+L5gCkAgz?= =?utf-8?q?Tze0C3GyL9i5NMXp6Phs5aH/xHFnE+rglWjlaenUiZdYyoJhh8Gdj4sNMAbgqooJc?= =?utf-8?q?wW68Y3qUq6y7L9YH9khreCUVli1G0f1PzNOTnPQ03HNJHjMFTU9F5/sh0oKlevEFl?= =?utf-8?q?Z689o7yHxws2llZRfRFJCylwX8cZzROvXYbngpUO1KfmmQg/H1DJqe18wDRCfmSmN?= =?utf-8?q?AKKKFFCww2vi?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: uckHVXbSJjmiClnp74k4eMG+fpBQ9LxGlz7NAIqmJ9dl9P533x1VEpvyqVv+O58oV2r3Pp8L9WDHq6znmn3EeWTHg/QLrVObsACiZ/LFwVWMWwN+Cygg611H3PJ4Q8QMzWSxCXg3q/vmHhHHvatkd5a+eLPgA1NQd4QKD6r14w7XG5JlmKtB7d6B9lcwfdKvEQ8X+fpHYvkgSZnuwrPhAKBhjYInyKTH6vb0FE+j15eFXcY2AQkcG04/zFHc6tDJWh8TdSZtJUQyLgro8A6IZSp1I8zep1nUP/25d/Z72rIa0kX6tRwsbf7tRhsM6otR8YcqoCE3iWgiCD8+1gKchQpTJJTJoStvnOCIUs7IebBHTvGd/Z9L0qk0Iw/wDGA3dqCM/HR4/i9UJEM1CHharGUS2j4ZU/UD0JtdOktGjnRpSLN1JukmY//BSNglI8QvanxXtU45qx0fJM6geHMpeTROSuvamGQX+OztpdwJ9OWCTJJgWYSqrXYlqRy4XXieE8YGQ62knr9AjHjl6pAyB+/5WbAG4L7n6/Z3z4Uy6ybKL42AtNQbJsM9T74p52A8sTMg/iUl8HvD7o3fTVhGKqAhxHh87y+mbGdZx5QWcWAxqCGmmNs+z27zVswnHZk4xTslG9erqfIkkYwTV8CuJ9wygiW1pso/bJUU9YnzgAHeFJOTWQTgQiiVd+/RAhIEazs3VX+3UwafD1Q3Q+BDL1ioLXPJQSl17YCXRVDmP40mGu3/oAVQmJbvRZme1GPGAHCqfgXWQZ9AhzhBulUHIs+tCEm90vNiOjlFmyuH4vpqgGnKOeixGqcWDFrKPAIKzqn5QG/iYWyil+wNt8sZuA== 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: 40fdee2e-acc7-4cfe-bb7b-08db19521581 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Feb 2023 06:07:34.1424 (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: xdyGuAtg7YTAou1Lo4ub2jGH2zKM6ueuFJxMquqG3Q/TKKzEMAJQhW45Xvfp5JRzuhnheeeA00k4NDRcIh78cQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0401MB4227 X-Proofpoint-ORIG-GUID: MVdcFcORXkaKIGPxjrSi3KTVCDU7AIMZ X-Proofpoint-GUID: MVdcFcORXkaKIGPxjrSi3KTVCDU7AIMZ X-Sony-Outbound-GUID: MVdcFcORXkaKIGPxjrSi3KTVCDU7AIMZ 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-28_02,2023-02-27_01,2023-02-09_01 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org In error handling 'free_cluster', before num_alloc clusters allocated, p_chain->size will not updated and always 0, thus the newly allocated clusters are not freed. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu --- fs/exfat/fatent.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c index c75c5a2cad42..56b870d9cc0d 100644 --- a/fs/exfat/fatent.c +++ b/fs/exfat/fatent.c @@ -307,7 +307,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc, struct exfat_chain *p_chain, bool sync_bmap) { int ret = -ENOSPC; - unsigned int num_clusters = 0, total_cnt; + unsigned int total_cnt; unsigned int hint_clu, new_clu, last_clu = EXFAT_EOF_CLUSTER; struct super_block *sb = inode->i_sb; struct exfat_sb_info *sbi = EXFAT_SB(sb); @@ -358,7 +358,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc, if (new_clu != hint_clu && p_chain->flags == ALLOC_NO_FAT_CHAIN) { if (exfat_chain_cont_cluster(sb, p_chain->dir, - num_clusters)) { + p_chain->size)) { ret = -EIO; goto free_cluster; } @@ -371,8 +371,6 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc, goto free_cluster; } - num_clusters++; - /* update FAT table */ if (p_chain->flags == ALLOC_FAT_CHAIN) { if (exfat_ent_set(sb, new_clu, EXFAT_EOF_CLUSTER)) { @@ -389,13 +387,14 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc, goto free_cluster; } } + p_chain->size++; + last_clu = new_clu; - if (--num_alloc == 0) { + if (p_chain->size == num_alloc) { sbi->clu_srch_ptr = hint_clu; - sbi->used_clusters += num_clusters; + sbi->used_clusters += num_alloc; - p_chain->size += num_clusters; mutex_unlock(&sbi->bitmap_lock); return 0; } @@ -406,7 +405,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc, if (p_chain->flags == ALLOC_NO_FAT_CHAIN) { if (exfat_chain_cont_cluster(sb, p_chain->dir, - num_clusters)) { + p_chain->size)) { ret = -EIO; goto free_cluster; } @@ -415,8 +414,7 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc, } } free_cluster: - if (num_clusters) - __exfat_free_cluster(inode, p_chain); + __exfat_free_cluster(inode, p_chain); unlock: mutex_unlock(&sbi->bitmap_lock); return ret;