From patchwork Mon Sep 25 05:29:44 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: 13397243 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 6A30CCE7A89 for ; Mon, 25 Sep 2023 06:02:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229568AbjIYGCp (ORCPT ); Mon, 25 Sep 2023 02:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbjIYGCn (ORCPT ); Mon, 25 Sep 2023 02:02:43 -0400 X-Greylist: delayed 1953 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 24 Sep 2023 23:02:36 PDT Received: from mx07-001d1705.pphosted.com (mx07-001d1705.pphosted.com [185.132.183.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53B61E8 for ; Sun, 24 Sep 2023 23:02:36 -0700 (PDT) Received: from pps.filterd (m0209327.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38P54CUj009680; Mon, 25 Sep 2023 05:29:51 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=VwsICy0PpltOTtNKO1i+rZvXSxl78uZaXysnpZ9LNAQ=; b=jzsaMHP9D3uWdnpfkDjPuVXLxkbQDqXbHlqX4XMXJS7jDYx1IuytdfCq/QMyR29UzPob 7Rw8Kglo4u1PS8G4KAXPvvmMdODhVn/DVpa6vV/A+7dYVVUVyN3u9woCcVUL+S3IrXmM UQO1DYYZ8WerfUS7xLE1UiQtcKG/i4HFQTkxRaUfyAImQMKmGMd3xiRPn4H6NtjP5HfA PC2Ef2EY2iyQgKz6Lp5T8oec2eL4rAZAkC/ClAmAibjXkSXIBckA+qnc6L6ejx7wuQiw la1yK6x+XOLQeJ01kZONaUZHRPgxtys08bW4DQyP0AYKDaE1rg4c2WvEP1XXN7KpAdnz XQ== Received: from apc01-psa-obe.outbound.protection.outlook.com (mail-psaapc01lp2047.outbound.protection.outlook.com [104.47.26.47]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3t9pw3sfb8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Sep 2023 05:29:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XjJ33Kkcu8jCtLZsEUAZdCS0gM77KwCO1O2ITmV005uxyNqR/jJScvdiQ2GM4OMEGP26o2Dd5r9bH9IbLDye8wMZUpQTISG4UmbmJRmmCiAzBe2CUQASRIIgSxl6bVWdc689nVx+3UljrEkicHiXJl2BRtkzjQmVgznQDVUguEI3r2iDxJq7Z74KA1oydUhg8xga5Qptx4w9a6RxkQ+4qCmXty7PzSPndXfZP1xqYSWWKKMqDsc9Bp9s+OxyeZc5lOfc8/Z+dsqzyS+uodnIcg5LdxCvVCV9KOp2iNjDXjjd2yq1UUlq3FhQaZkjkxd8N5cNGVgM079fIQ2mGTXG4A== 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=VwsICy0PpltOTtNKO1i+rZvXSxl78uZaXysnpZ9LNAQ=; b=FitErS4cx3ABzA4tBY3wf0Rhcdcd7aQDiE5hm8T4177g+W6MDm9RBU8qvwntYXWfWXPH50jTmJ/IIt7ITfV/lgaYIbSPxaP8VxCKbB2c9J0HQhUYQCAJdvs+nJdyaRhv7f5NPGtN9Czm3d1FVxdqv99H4+4lZ+Og8HWd9k/QsrkaKi0IcHpoRTatODBr71JyufK9cebH/WsbXTmcEJr8qNJYqDwF3IRQ1b1GbYpTur3wPzSvjqouzzKSooShSdUrFI9UnNx7V/jRBvHio/O8692e6jakmtit7o1MVg484+KShZPmxtjGCkKX7etbDFHceNFsmbvtRz7tC/jXgCnFHw== 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 TYSPR04MB7081.apcprd04.prod.outlook.com (2603:1096:400:47d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Mon, 25 Sep 2023 05:29:44 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::f9d4:e3c8:e9c0:1ad]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::f9d4:e3c8:e9c0:1ad%6]) with mapi id 15.20.6813.027; Mon, 25 Sep 2023 05:29:44 +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 v3 0/2] exfat: get file size from DataLength Thread-Topic: [PATCH v3 0/2] exfat: get file size from DataLength Thread-Index: AdnvcGEzwPu3dXUbRDKPesA1ujBe2A== Date: Mon, 25 Sep 2023 05:29:44 +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_|TYSPR04MB7081:EE_ x-ms-office365-filtering-correlation-id: a7f67db5-b593-42fe-fd77-08dbbd886cce x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dO2yTk1JUp/RuGlLVs8dXbzhGN2FZ7ArTBj74pP3HlDp4IwYYjIi+4rrd6S7p6iu00tVGg606ZOAH9Dyn/6c/M/isqCDWGny3/ckYEFEscEfDpwnlADSXR9D/OGYktiwd4t8fZ4/l2s5+Tv5P9Wzcxr28fPD0skPaJBBuZeyZSpmQ84eV+gdtY9HUZ9s0t9oNkyfKuGL9aOrjICzg/C6ECuF1/Vv5Qa5h3xIcEGgvLNmYZTkOA8E+K4wRWoOEElPTYs2vPXTKDDzFZniWDf8ryDbhfTg/PPr9Uh6mG4ZiCUE0CMLy20Hk1w/8nOrUEeNwuy+pCcCcQiAwn8SXdsVsDb5DzQIxzA6ou5HD3QpQAD7CP7cu+nLH1LvP71PdpRXEW7SC9sfeyK5Y+RGbfJgCYLIYbLMylgRxJBy98lZKzMUuIDRM/GhEnPQLd1U4r/usVJk7Ip5zJeRuvC1dTkza05LodB2fP3Iql3HpYqqyRzO0JHcIw/VS+aTBJoSoWJiMWYo1NYa5vk0lp9yqEHXUc0CxIDax5Slt4sJdHqAQuMOh642VxO3NtBt3FNAllGg3h8gOObpmOJIoweMCFiT56LmBY0VHM4CrCsCyNDOnbIPT2DD8+zgsROLpxHBmIWd 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)(39860400002)(396003)(136003)(366004)(346002)(376002)(230922051799003)(186009)(451199024)(1800799009)(8936002)(4326008)(5660300002)(8676002)(2906002)(52536014)(316002)(41300700001)(66446008)(64756008)(66556008)(55016003)(66476007)(54906003)(110136005)(66946007)(76116006)(26005)(107886003)(33656002)(9686003)(71200400001)(38100700002)(82960400001)(122000001)(38070700005)(86362001)(478600001)(83380400001)(6506007)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?Ph7bsNUuvyBbKnKs5gvx4c4KE7gT?= =?utf-8?q?U+WLyzCt7rqU0GQkQKYX+gkLTilihAEH2sYHUMTX6j4oPOlj57nMfS7Caw1dZ3nxU?= =?utf-8?q?LF4EDg6XfJp6pn2EKACAQkckgy5sls+sx5radvPfWrc7heaEJnub+vNVyt5Ahat8m?= =?utf-8?q?rV4wlplLJ0k3H2xWBuG/vNpX4IXjUM4GYU+A+WvXhA8nOijGBRt7PJ2dt8jmdxMcY?= =?utf-8?q?729A4lK/v0vofvgZ93RtX7y+89AsZNuC0DJNICdjo3apyHK1TJaUFaHk8i+yW6T6D?= =?utf-8?q?802DSDs1FlYn5DLZx4DZMuoPypEuYrVD2AwaVNPl+DlWnCCcDLbWA2A/4BsxBIkBZ?= =?utf-8?q?IT0tvphpPqiEJr4KIlfR59ezWlr1nwS9vORRq+sjcBjltt8dK4nMrBU28PQhYfm8n?= =?utf-8?q?eOaZb+UEPBNjvI3ALc1NkUCw4jyLaShws0Ox9CPWDlVoOct25C4Yv5vceBvDG+VKL?= =?utf-8?q?BFLpe4wDMVBq6vakdn+XLRQLi8xy0kX9VMzSJZHkB/ingYYDLDMiGh7gzHs8lw25n?= =?utf-8?q?GvnnMGh0nj9a9JHnGPn5gLPzPwF0xtB+GOSuNlQzyAhph+aWaHQwk4ImxiQnsuUoZ?= =?utf-8?q?HCPNYclT90LCbxUsQcNv05amYWVqI54vLnBeceNGfknso3gyqI8xWcEafJXHNWPqX?= =?utf-8?q?HGnF+N/68s5GUxa4Rm2EwMHVTjeHZCZwGDoEFzQfw2tN0KdTkpZtYvf57lBGDoAX9?= =?utf-8?q?fQctT7Zh/mHzeJf8dh4dJ7tkr2Ssr0aPjnmuA20Rh5nD7CGflSF7Ojc/wWSgahQcV?= =?utf-8?q?lcMaODizjPmbpExS8UM86pBvGqEuhRw88KtkxA+cacM1OxPEmaLCcQ9Nw7BvaUSez?= =?utf-8?q?GX67aq5vZArGnmtBriCOUgAjTtxLXkEbqA4WXxO7ge//N2tNpdolKCfrJa4tMcQwO?= =?utf-8?q?jmOsVfR4Rm/aBC2KCC6iaQswn8MWyMqRfB1Z++Yu9wg5hkDzeCK2CFansjkOzZ+DT?= =?utf-8?q?aE9DMA+7ttV8MWx2pe51/rgs86Krkohaynnfhh8V4q/Lju0SmYVo0K1DY97MjNVHd?= =?utf-8?q?7OC4L2x2STMtkTNdd4qSlbsrgB7GaS3BqNq3aB9valjX1YIzu/yQeJvfsmvj7PPYG?= =?utf-8?q?GpofWBCexzjss+YUw5T/V+3Kn7Yo4e17jRoAHtZHsDrdFYc6VhRcLFdUh6sjMLlvO?= =?utf-8?q?oZJ0bLsr7CybuYaGI1LWHqelKDNY2GtzuXpQGY/4NZs85quQnrAJujpDIkmZLa+rh?= =?utf-8?q?NrefGabOwuM+Ly2Bl/o9omnM9R03bfNbAqCqaBHLci3RUnfZ3tSF4PvHELyzw47QN?= =?utf-8?q?WS0/d8hYoC9eZrCnxVaMt2hLAJZ+ZeHJIoucAlEpO6AuIH3XKXk4b49IeQqWhSgzB?= =?utf-8?q?ACoe7uDW9XJMCI006v80tFhfGCbxVRUdydLI/Cu3sKvUmPSckQnL22aneNEhQW1iC?= =?utf-8?q?U3LFtmzaXYWUFKBOhyBouCaNGNQ1P3SKWNTWQcdLDMuHqIqa3w7Z1JGP49PMhCNIT?= =?utf-8?q?8P8lClMP46RWPG95tWlr02eVTptEDl3gNmhcEujoX3l2PueV2SMCnlnQPho2oWTzd?= =?utf-8?q?9zY7tdv6zWWo?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Jv/Nl4eZF15INO0CJZq+acs2arjSXOAWoB5DkHeDxdEmrDdtAHfLg5wwIoGi+e/5q1XFMqokmhJEaYlzFpAchJP3AW2OI0kvleOuMqYBYnM94eG5OAm3mZ5sSGIkT0PPO3L8K1/AaDWH46QR6sMTeYcualCjhPQCH1UzEis1Ca81vsUTYwoyY0ZgugJzgQE2jfEQVIJMnThoQEVEiPFkuFb0DwePxQRSn2diQT+44N9znv8mY1vFoJ4zp+Chtyayepv/+Z77C3XDF0fIKe92amKoxLKiSXreiXI7YjhyBNAE7J1pkdjeB2/ekxzIEJde1Hn5ffdxGtVWMHiM1rYIbNSiZ/nARELJCNzOacZXPCb3G15Ux/6W8W3ratDgj+vw3iIW552Ldt2zevqd1ZsrTqVVQuDYXlDTcfRAGQSOgZVd6fMoCqlBNkZiXI9QqJUpXA8yU9hRkzDZNKsQkW5udMP8KjuIjD1lgttCJsHdqdonlHSZQ3wG31H0NJ59NJR+T2Qf0RPaYcfyNcWObm2eX0N7nzWIrYEQ1fb85W2XQuxrpfZKLgwc5rtdt07HWFnPaa2mshyKuFmMk1i2yt2cnpsJK/KtkAAFiJMliTtiotgDpX4L08TGWTPEB8T0xf6f0U213mCmUSSdV+K6XpYKeyBIxVAILubVB+I2rCneYH+tzF33eiFuV31LseRW3Yt3sOndMTgcwWcMAviFtFO9CK3IwnDBhlSLeXwEb78GJRlt1gB2N7eqbLZ48LnvbeNHQuduzOozAQUpcGyJ3XNL1x8jbuj3N0xFoGbn5wQNmkYaFOC3x6Ww66mzbklLSnOMSwiPqG/KRQnF2VQrJjnr/w== 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: a7f67db5-b593-42fe-fd77-08dbbd886cce X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2023 05:29:44.1239 (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: AxXJOQxXGtbi+1XTmUVwSegEnv5yM7fJtRpO4Y64YB0oaSj/qbcLXv/5fwr/CzUc+N/A34fYxh3xTe9gSDt8ZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR04MB7081 X-Proofpoint-GUID: qKdguk7lLDYX1VvpAuu41zKoy1jyX5P4 X-Proofpoint-ORIG-GUID: qKdguk7lLDYX1VvpAuu41zKoy1jyX5P4 X-Sony-Outbound-GUID: qKdguk7lLDYX1VvpAuu41zKoy1jyX5P4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-25_03,2023-09-21_01,2023-05-22_02 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From the exFAT specification, the file size should get from 'DataLength' of Stream Extension Directory Entry, not 'ValidDataLength'. Without this patch set, 'DataLength' is always same with 'ValidDataLength' and get file size from 'ValidDataLength'. If the file is created by other exFAT implementation and 'DataLength' is different from 'ValidDataLength', this exFAT implementation will not be compatible. Changes for v3: - Rebase to linux-6.6 - Move update ->valid_size from exfat_file_write_iter() to exfat_write_end() - Use block_write_begin() instead of exfat_write_begin() in exfat_file_zeroed_range() - Remove exfat_expand_and_zero() Changes for v2: - Fix race when checking i_size on direct i/o read Yuezhang Mo (2): exfat: change to get file size from DataLength exfat: do not zeroed the extended part fs/exfat/exfat_fs.h | 4 + fs/exfat/file.c | 198 +++++++++++++++++++++++++++++++++++++++----- fs/exfat/inode.c | 108 ++++++++++++++++++++---- fs/exfat/namei.c | 6 ++ 4 files changed, 280 insertions(+), 36 deletions(-)