From patchwork Wed Mar 27 09:03:47 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: 13605981 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 D5DFB36138 for ; Wed, 27 Mar 2024 09:04:18 +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=1711530264; cv=fail; b=WHbnQqzXIGCflgUI3sfyQj0ULsrKS4fhaHfplFADOF3Q7Hg61wc7puFHFYO/1j5ihDT8ehYhZ7sV+qNTmkwRSnrtOFmDg7hoMi9Gknmbe5RTTKn7hC4fbby6w1mpQPpap631eL/6M5AauZ26KW9gUajqfbwCjqdKqPk+jaRxhuA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711530264; c=relaxed/simple; bh=sozqAX2Uwoi0iTIh0IRYSCDxkr3asdqFJ27naGMlPv4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=kJ2UFyhzpJqhmVytBdQe44JZ3Oj244b5MaJEI37D5zdvfOjI0KRwqNPdyC3gD37IBxlNIX8XmIagHsteJX3EVPecZInAuW52wrkdfdtACbh3SeE+wrsCVKoEvjG8OX6UpCwR9rdI+/GUKOqnxgSHArXf34k1VlKeMGVsPYzjEcA= 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=geyEDgAZ; 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="geyEDgAZ" 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 42R44iLr006414; Wed, 27 Mar 2024 09:03:56 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=rvtDXlK8+M00iqNrqZA6TTFSF6QARt3lWVlxnOJwJIs=; b=geyEDgAZ2prp3Zkx9ynlvAtsXRkRIOZ+etwr/O9TDnWyVSZZH4rWN/NHwYHH80djqvwb Sn3LOa9NMuj5XSGrv4T+d9DWIaOp8yKiEaUzbhYA21xAuvq1aqhWfAl47BP6wUOT9Mxa lAhx8w892qAQ68Yz1xHPT+UnKuWiTyQM+vNU0Zm2hZfhEdhujEyUZx+uhWDpb6VBop7R 0lCGVlLPQrpiWQW2fJWvOXAmQD+SCJj3J1IhBBYxPZttYxahOchTpaEljZzlla+a9pbw H4oVxnR4UmBxMgqLbH9pz8yAD5wu3EEoRC68Nt0ynGJfQvzewzm0yUeUhUuIigkKih0U 1A== Received: from apc01-psa-obe.outbound.protection.outlook.com (mail-psaapc01lp2040.outbound.protection.outlook.com [104.47.26.40]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 3x1pe2kxw2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 27 Mar 2024 09:03:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ItXrMUw5YLToWLBF84XWNPby4pFg0ZBlz8YW6gia92Ywbd+OFsZ2/dEGgUhg5GibWD20fliO0CDbfDqM1BHmjEHY9CuYjfzKSBgnJ8bR+RwSnJor/YHpagxFepeaZLOcbo1W+5lEXtu6OD6Ns8+soKSuyXkSW2FcKIc+qnnEuZ0R6MuYHhitOXeQ43eVOvCh7WRMu8ET05tuUuiww6bVlwZKpEuG4kucIEFhF7SGUmg428WPiqM0OQLKo3BbzUDRcjjYeheeX8/cT59BaglchoDBZQHAF46QCwSxorqCPnXJiyldQSk8lvlmFhqzbSFTQDMaL1NvCC24eAhAXFRhqA== 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=rvtDXlK8+M00iqNrqZA6TTFSF6QARt3lWVlxnOJwJIs=; b=JCtjj8YdlQJ/zDJr1YYl5Zv4dATVyHu4t9PntQHmDxke48w0BxNWNM7Q7mVLO/YKgW0JZUB8nvUEAyTxCBQSludV3bMTry+w9YGOvdQn/vslk6nrjI5YFGb+a/9+P/i3aufwSTmoEG0vB9SwVRwZOqKHYYzuYfoTT0T4CUKIsJ9WTV3qpM+m0oKh80Zv+TYqRoZIot0rCqvE6n/5/I9oiPIuG/pGmb1FujWyrTeqLNFIvvj9GCeoH3nv6W8yS7qg9lMTJOONz2t6OYhaAMK228yKmurHMDuofdJuhP9VJi8uzNaWngbwJ854dR83HrAT3Vjb6Sb5QYZBPbNBh8zQuQ== 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 JH0PR04MB7058.apcprd04.prod.outlook.com (2603:1096:990:38::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.32; Wed, 27 Mar 2024 09:03:47 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::b59d:42cd:35d:351e]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::b59d:42cd:35d:351e%4]) with mapi id 15.20.7409.031; Wed, 27 Mar 2024 09:03:47 +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: fix timing of synchronizing bitmap and inode Thread-Topic: [PATCH v1] exfat: fix timing of synchronizing bitmap and inode Thread-Index: AQHagCUhy5AEis88KUSAmZ0ptvY6Cg== Date: Wed, 27 Mar 2024 09:03:47 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZPR04MB6316:EE_|JH0PR04MB7058:EE_ x-ms-office365-filtering-correlation-id: 175fe624-6acd-41d0-776d-08dc4e3ccfe0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: i5vSv7MX3mnUZIW8fqlK1c2fSbs+pYQf2119RDSvwrwgjP4RhM6C2i/K/bvUBmg4eV9QU03Vw5kKQIzLyXcMTOgvKjicLNNwyBQh/xRblGbQacOjkb9TBlL+cpAAHFaLvzBINfzZZ7gdPZldhFnW0kV30fyJpNENaYXPrG1QCdd258i8MqnFiuPB/dbn0WHXb0fGY/i7gO1ji9bvsLFdUD8trXHYrccaEuTCbVThL8E3/ZHQRlZz6FUmqkCg5fVWQUxUGtR4FwPtPxv8COdh92tSwxYL2fdZ6OxdJG+hCrjuS2jyQzfLTit13fiSLLQgr/RksNog+mK/lUfKPCmg90PlZVHsPFHu80A+ZVSXPOCYpNRI7oVNT3IjN1kvAcRcaQcMirtmiKgJOHU4vDp+ZELxXbHfOBEQx1MuO5U1yLlYeefpVKRjT79Hdc7sP5Fxh3CTwnuxQz67eP6oYuV3mEKuk4m09/a1BWRBUjtT7Aph7LxcyIoVN6r7o/fSDOOy4bMU86NqlBDbtNseFyOdkyr+AiX6GcyQCm2lDtkSqieFYy4my/9DtdbgaV4euqfsjXQMXbPy9PJillKg9814d0Xgiubxfr4B0EhA3vSSqui+YujRJ9NaUgHA/YI0h0fOcqsbubtUQBseQUFYppfEOgA9SG09Ggmmse6YhRbuBILbxscPS3+Gn6rywwq5uCJqJG2vE/dvi0oD1z83Qyn8mw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:zh-cn;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR04MB6316.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015)(38070700009);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?eucgb2312_cn?b?ZUxGMzdWN2ZTMjBaaGZONmVj?= =?eucgb2312_cn?b?bU9xdXB0Qy91VFhrM2tYaDluTnlVVzlqNU1kdm1yRVdreXhXWWZhSHQ0dXM4UWxT?= =?eucgb2312_cn?b?b2JWSTFieC9lZDlKUEtZM1NBZWtsU25EUFNON1RleUhCSnpmZi9pTys2UlkwbVc4?= =?eucgb2312_cn?b?d3dvdmwrdUdDSkJBVU9mT0owdFFvbktCaXFwdG5UUFJFcC9PUE5SUDVSQzBNR2xI?= =?eucgb2312_cn?b?Qk8yZ2RucG90bkNQREk5eEp3TWQ4dmFUQjB0V1E5ZTdVaStWVFdWVzdoaEdRSWk4?= =?eucgb2312_cn?b?VEpCVEpocHcxN3hWMFlXQ3RTYXZqSWtOT3Jnbzd4eTIzUk93VmVab2tBR0p1Z0x5?= =?eucgb2312_cn?b?WjgzNWFQZ3pobzQzZE1DZWpHcE1FUlBLK3pGdHVld09HTnlyZkU1NmU5bGFYNG1v?= =?eucgb2312_cn?b?enRnKzhOV2xJYmU3Vi9rUS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wTE1RNmR5Wjk3c2RCMmpYRzgvMUs1?= =?eucgb2312_cn?b?QlBYVkZpY0lGZm1yRDVLSnVKbmUzRm9UaVhCeEVrYytWUVFZVmRMV009?= 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: XOmTtbp3u9Cf7CmoucxyFmvnca4a3fPulPFDt6egbJ8NdmEBCVBCHtawMSyurWp1hsLO3zGZZorEd1+ABDKa8p/XolTmBw8miBcy02yPLCEwWTK3iUJXF22DbTJ2ekUi523d7+S0+trZcyTLa8Sr7zNQb3Jx2+D8xIqL572y7/WBRISUnDpqf5+DQXm4OqQvGbxKUKtzypHajfe3eX1LYaRJYHBNpPyWRhA9bffv9A8NqTkV/fzxeNRGOqCL4JA67/RBted0IbtfG05Di66xHGzpL4JoDJPY/f/G1YyNJUcXo0rSQnf2bWBWYrpqQy8950yjfSIONfWB2niQWjOoaikIYH5AZvFclm5+qDg4PdEAdUsUXwpQp6Mzw7ugYLTs5u7HCg+a3vMEjSTryBChYcvTojdmijNr9jPDSehCKmyX7JSXxRzqRQrZxYS71DgFOdEEoTU0I5atWwdbJXMsy875NIWvjZAUaFJgpJ6BbvAdbLnWD3QGURnYszR2XYL6mxiVbgtHz0TW/WK5Sj4NoJMzi7Dyyhgy8qKqgZF41FeL+H2XCxwvASPGIvleC+GazxegFyXgATniw4sf5x0tpK1Nb7xNzt44VSAVlXYgZt44fheSG6fratiK+eZDlLMt 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: 175fe624-6acd-41d0-776d-08dc4e3ccfe0 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2024 09:03:47.2190 (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: ZYZpxTrtITQT6eNGDwNZOFzpf8dmBXjd0QbK+Ywca7VQXx2Ja7guSyZEapShdlPlR15zfnwZG0JQ57YNRnQcWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR04MB7058 X-Proofpoint-ORIG-GUID: vHsHsNLfPIDKd7gd_-WkQfqKgpM4wxtk X-Proofpoint-GUID: vHsHsNLfPIDKd7gd_-WkQfqKgpM4wxtk X-Sony-Outbound-GUID: vHsHsNLfPIDKd7gd_-WkQfqKgpM4wxtk 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-03-27_05,2024-03-21_02,2023-05-22_02 Commit(f55c096f62f1 exfat: do not zero the extended part) changed the timing of synchronizing bitmap and inode in exfat_cont_expand(). The change caused xfstests generic/013 to fail if 'dirsync' or 'sync' is enabled. So this commit restores the timing. Fixes: f55c096f62f1 ("exfat: do not zero the extended part") Signed-off-by: Yuezhang Mo --- fs/exfat/file.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) From c155bda0ba189b3d2bf873e64086b23a07c78ac4 Mon Sep 17 00:00:00 2001 From: Yuezhang Mo Date: Fri, 22 Mar 2024 17:52:19 +0800 Subject: [PATCH v1] exfat: fix timing of synchronizing bitmap and inode Commit(f55c096f62f1 exfat: do not zero the extended part) changed the timing of synchronizing bitmap and inode in exfat_cont_expand(). The change caused xfstests generic/013 to fail if 'dirsync' or 'sync' is enabled. So this commit restores the timing. Fixes: f55c096f62f1 ("exfat: do not zero the extended part") Signed-off-by: Yuezhang Mo --- fs/exfat/file.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/exfat/file.c b/fs/exfat/file.c index 40aa134ad4cb..e067a82ec62a 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -51,7 +51,7 @@ static int exfat_cont_expand(struct inode *inode, loff_t size) clu.flags = ei->flags; ret = exfat_alloc_cluster(inode, new_num_clusters - num_clusters, - &clu, IS_DIRSYNC(inode)); + &clu, inode_needs_sync(inode)); if (ret) return ret; @@ -75,12 +75,11 @@ static int exfat_cont_expand(struct inode *inode, loff_t size) i_size_write(inode, size); inode->i_blocks = round_up(size, sbi->cluster_size) >> 9; + mark_inode_dirty(inode); - if (IS_DIRSYNC(inode)) + if (IS_SYNC(inode)) return write_inode_now(inode, 1); - mark_inode_dirty(inode); - return 0; free_clu: -- 2.34.1