From patchwork Thu Nov 2 06:10:20 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: 13443430 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 B5022187A for ; Thu, 2 Nov 2023 06:10:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b="Vr0f+l6y" Received: from mx07-001d1705.pphosted.com (mx07-001d1705.pphosted.com [185.132.183.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA3D4111 for ; Wed, 1 Nov 2023 23:10:42 -0700 (PDT) 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 3A20Tpqg009008; Thu, 2 Nov 2023 06:10:25 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=9uq/XVxP2Sv0y2MiuhbU/RmhijkS2qlG/LIhcsbkDhQ=; b=Vr0f+l6yJDKRLo9wj3gkoQEJ4qThHGozmILzw8tRsBgU1En6bnPNiisW5uxp9nvT/Odl sahk3qnwSerXiDh7Cr9U7kuoiOJ8diZ/JBE80xGTv9LZ2dMBgA1fElga7aDj2+6yZdj4 1ynZtn7GC1P5GkeIw7Lg9tYdeqrSuf/nR9JZPD+RealO55YZdMuOYiiE3L3Y+84OiLKV 9NaWg+iQf6GIRWASwnkXEHLkR8vo/kZoXvSdcJgE4tAr/OFJ3cpqWNxGJCuWVVkHXDXW 2HSJip52cXZ3h/6qrq19k3tppmTvv6Q3E4vGLHuhDqLCVUWYiLAJImlGTztNTXDcd2cv cw== 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 3u0rxywa8u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 02 Nov 2023 06:10:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BoJ5PSDqi9R9mAju85TTmtxVcS2zJU//vDTnraSp1iTJwAQEm+pFFYTmzTACrvPBL5xG2s3ZsQgWC4je27bQiq3Tes7bpo/r3uyDraTAES2cm3m2LRT2Nz89YURAxDuCGDN7ApnOQ2wN7BK313dTozzNvvjvUhwaga7vqSCvkPkZBp9mm8/UNDRtKeGS9Le97XOzRHfYmeQU9rOOtwUZUKrA1ENAw3ViaA3/JEqZnN6hU+67pzj4YoIFJQtMegRNeJ68MAbu3Rd5qPmZT8BjJCXpn/720YAuJlig3ok/+rH0AhZa3Rgmr+cey7nGZH2IpNMJebmkTaraeXp0zZfZsw== 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=9uq/XVxP2Sv0y2MiuhbU/RmhijkS2qlG/LIhcsbkDhQ=; b=NERe8Y7McKXqJ1l1iNKeq2EWj1hEhXPKQ5OAcBrLmy66UM65MmI1r9wP2k2OvxR3wHZ5dvSbWzs5Jz8FV/txs7GNT2Z4zRZPusuAEIwE7QtVDmNBbYBjjjltrrE17xre/YIy3kf8e1wcg7lyiYZJNNj90wbH4BcLU/sQZZvULaVWBtUimMCDDSG1RdhmfMBwNtc2Qcnannqhn8ylCfTAHb9Nz8niWkMl1fZAxYa6pIyS0YFmsf4edQJ+8dBodPvwXc4vF0Ey5MEetiJEtHUxuizpF5/kB7PVq8JzbhCSqM3M1KLJBcHE5Rql2bap70wJM+bd5y0Vtp54QkPbfrqP/Q== 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 SEZPR04MB7408.apcprd04.prod.outlook.com (2603:1096:101:1a0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.20; Thu, 2 Nov 2023 06:10:20 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::2fd0:f20f:14a9:a95a]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::2fd0:f20f:14a9:a95a%4]) with mapi id 15.20.6907.025; Thu, 2 Nov 2023 06:10:20 +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" , "jlayton@kernel.com" Subject: [PATCH v1 1/2] exfat: fix setting uninitialized time to ctime/atime Thread-Topic: [PATCH v1 1/2] exfat: fix setting uninitialized time to ctime/atime Thread-Index: AdoNUr0C2LAJqTRjTDmnw7fbPMjyPA== Date: Thu, 2 Nov 2023 06:10:20 +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_|SEZPR04MB7408:EE_ x-ms-office365-filtering-correlation-id: d3533538-4f71-4302-7fcb-08dbdb6a6488 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ps1tAbVp22J13XZO9svMrDENwWqDpXMNYfBruwVbuSI2Gv/9S4XdNxs7QZelJKjLXBCbVmSRv9bK6D5u6r2w0sl/diEhU2g94fGoIiHjTyMMmWIU9WFCq6K1FwYFfxIHK4mgYXWynpSNS4s2myvH/GG2vKx1MtlFJ7GXnVNh2K5eD2g91pJRbnxN/m/sErNsGTnz6RNkGh7BuW3cdoPpXxgTcoNhNnttL2FOzbxlyGYh2wvGZ1ecjkL47C5bMhDD9ULFxML/MNrRiMHZUZIrHx8sjpYTv/6VK3pMiquPo5A8/d7L0cNQQxhf9vHVVGsR0niB/z1ZLrqcg5P/0FuwA0IIVrWo9SBmwcPUkzOhnKgz3n8DiqcBNAurSy3DcONuPeaRA2OJxOIUlbthyhyVLY1qFUdFTJXAGsnUosNVdD2nAr64TKTw5dRZBeMPL7XtPkuLPQjQqlTWb5ghq8mfsm0NTz+l0qDp5+F0R7VtvFgZZGEa6M+ww9e/AT8W64Y38j3Az5y88u6k7i638UmcDRNDO6gGOTj0CJOrldl3J9hG4347vII+RmgthKgnj+1jvYXw1zVs/6iNpCgdHE29t4s5z+JIgxk29SQGHCK9fFMcPTXCYARb2SjGgvhHCMmM 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)(396003)(376002)(136003)(39860400002)(366004)(346002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(110136005)(66946007)(76116006)(9686003)(478600001)(71200400001)(66556008)(66476007)(64756008)(316002)(54906003)(26005)(66446008)(52536014)(8936002)(8676002)(4326008)(83380400001)(55016003)(6506007)(7696005)(5660300002)(2906002)(38100700002)(82960400001)(41300700001)(122000001)(86362001)(33656002)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?Zbml1JTDHz+1gB4hpftg5QzV77go?= =?utf-8?q?eE2dhX3uu9VWd7Ci+eqm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aWpApG3mjnhyZz/u3TO11LZQ0xChTZL6gtXWiqP?= =?utf-8?q?/hTFPotGiKZ5MTuP0sgHBT4HtDa+2CYRYh4OQHU5lbVpdmrFTNeZO5UAgQoM2qQxy?= =?utf-8?q?VHAs3wsF9KhWWuzEyv08+o2HKLxnujX5r5u6z4r0QuONagelYLNZ12nHSuDK9/kBu?= =?utf-8?q?sVTw52/WcqhzmR/p0S1B5NDsTno/d5DEHX5z0v2TwpwxzjSMiUeHH7feuu2Aj+4K6?= =?utf-8?q?W4QorNexO8PXFzcEjVBEKvNAC0/ylYyOwOqvAu5i9iO+ZnZUlOaNlLCNdVzigdCme?= =?utf-8?q?Ow4P/Qd1kwPteiTUEUgC0GFrFs6ch6owXjYbRcSRXA/QEcvyZiC7sQlooxaz4kUyw?= =?utf-8?q?JTAJN/95zx7YcPpEcWgi5MuETYHB+w/dqqVURK72dICNEEPxlO8NEImCO6acydEX0?= =?utf-8?q?znwDvAYWhgD+DqtGoRbAmu6i1TKBzzSSMFhTwjrNFINFsw9B6IIkTLXAraP5qHGmy?= =?utf-8?q?+pSWEVdY+5IW8zXs9aO3mfh2/f812Ygs2HD6I5B9MDUdnWBnLQS6DfmQxMhLcEjkX?= =?utf-8?q?C3M0qGyA3Oa+mM1XeMEurCHjwt5ZsgC89fmfcEKTYQn3wNxsrVMVoyCBcjWpNmgb/?= =?utf-8?q?liEU1f1jza7F?= 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: praih2zd7ZHPtXQYnxGLSTi4XSpDzXcb+gQOH0d2U7yJXBxuqsbBw53W3FUvy/UNmZsR8KyYVpNc4lVh2DisdVQn4EkzZ/yk9bMt8PTJEArgdFuDk35jTd+Va+M5svcti5sUMgsP4+K10RZUVhEvbXsELUeeD3vl8JekVmOYhmn8l+DOaRqYigw6SNLGoHhDvFsBSgWvT8yxV85KpAmv/rmxdn6l4oIEre2m4jgwWpKax7MBp/Nq7kPP90L9mAon6+stSxEWmGvLsd2JPKbklaVH31Kv3K40OMdYLq54oc4/MXjxUJ+rMyoXSk0Dsq/7ljQiygCr9wiwaSkYbNqjO6JsXzyDP/jQEz/j0p1rh0m9AgeWd8vY7HqmWIajc3Udd/hxxwb10sQfH60uLzbP2sFOJNoWefeKiZDWcwfbOi6SDhX3pL/uz1uWk3t8E0IlSKJPK4E8f9oMz+wVsVsKWlNZDdCOItqdptE9ct98pBIu/fgQUJJkGlL/zogV3cpyo8GHDjtzawdhMxQk9n4m31i0y8uqWlgFxZPxOKkF+UnoLryuIP18o1QvoH2ydWYdvAbm6H7+RY3YK2NpjHL1NTh0FNr3jz5D8lVxcsfIHn4xItHTUKoj3j99gFuHVIar2/G7TamjcbruYjKJoCJBey97GtAcOTNQcITbXJW1kvry83MNSxvWkWCzJinqgR374RMl6WjrzhoWCJve6V3I/vhVXPsEoIySLVw03+oZO6IWEFloW9+y161R6AuaAMqCDjJ8OzlujjtzeBtRZ78IlUg9MLtabxS8iLtRjDgC0zZBTdwOka8Wd52Ur+LPA3nLlNJ4F+6XUVObuXApCbddimU/HjfYTcw4NWNucGL1Fp60mS7S+aHCmu1jjq3vOGuy 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: d3533538-4f71-4302-7fcb-08dbdb6a6488 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2023 06:10:20.2707 (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: 9K4C+ZxnuqrOnPvJ67iSbVov2APSydb63B5BFH7Dv8vLR+Kf2fs5i9J7YRHjehnMBXAAxCYdmgxmum5jS7F9hQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB7408 X-Proofpoint-ORIG-GUID: 8RCnjGoXTgKwBz5H4WpdIL4Cc8ChlTCP X-Proofpoint-GUID: 8RCnjGoXTgKwBz5H4WpdIL4Cc8ChlTCP X-Sony-Outbound-GUID: 8RCnjGoXTgKwBz5H4WpdIL4Cc8ChlTCP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_23,2023-11-01_02,2023-05-22_02 An uninitialized time is set to ctime/atime in __exfat_write_inode(). It causes xfstests generic/003 and generic/192 to fail. And since there will be a time gap between setting ctime/atime to the inode and writing back the inode, so ctime/atime should not be set again when writing back the inode. Fixes: 4c72a36edd54 ("exfat: convert to new timestamp accessors") Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru --- fs/exfat/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c index 875234179d1f..e7ff58b8e68c 100644 --- a/fs/exfat/inode.c +++ b/fs/exfat/inode.c @@ -56,18 +56,18 @@ int __exfat_write_inode(struct inode *inode, int sync) &ep->dentry.file.create_time, &ep->dentry.file.create_date, &ep->dentry.file.create_time_cs); + ts = inode_get_mtime(inode); exfat_set_entry_time(sbi, &ts, &ep->dentry.file.modify_tz, &ep->dentry.file.modify_time, &ep->dentry.file.modify_date, &ep->dentry.file.modify_time_cs); - inode_set_mtime_to_ts(inode, ts); + ts = inode_get_atime(inode); exfat_set_entry_time(sbi, &ts, &ep->dentry.file.access_tz, &ep->dentry.file.access_time, &ep->dentry.file.access_date, NULL); - inode_set_atime_to_ts(inode, ts); /* File size should be zero if there is no cluster allocated */ on_disk_size = i_size_read(inode); From patchwork Thu Nov 2 06:10: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: 13443486 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 ACF096FA3 for ; Thu, 2 Nov 2023 07:46:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b="illgXM+E" Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0083BE7 for ; Thu, 2 Nov 2023 00:46:02 -0700 (PDT) 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 3A25b3o5022467; Thu, 2 Nov 2023 06:10:32 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=z1ZpYz8cFW2Vb3qG63+OFoKc2zg/6x1FWuOVFWzS/Tg=; b=illgXM+EVIy7wLp6aKm4D0a60/pjxF3lVUU6An1QvkPnffKcS60BpBp/pHK+Cf8iUf47 KMeqr8XyIRJAzTo8+emrd6CmikQP8nH2sRXeCTlYNlkUwfLNfoH6whGm6Y5WlhzCDQUm MUCwGCFYoPFDJbejnC+AvsEcLtXeB/s3spDnYAtqBc3/vGZgqmSnmqyXXKabmjnwYjZp c4lZDqf0rDQi4Tesw715EPQHjMmxGEGZKzsCX8AilS5qtcOtvL3WvPXXQLZ9Duy+lxzC tm+Zk2KSo6ZNVlKBdYVAW4V9mdCSHemxIkt10rkn4ht0wQGXspJwcj+B4Shs98DfuqmX 3g== 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 3u0rv659uv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 02 Nov 2023 06:10:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j/bUGsTW8g1QJIBH6C5Zh/zS0W/1uDukWJuoqai5/Bq5/dJWI8Q/reDovn7UESKH6KhsCBQlTfEBoR3iQ32XpFvBdi1gumqVxj/fAWXtwt5XRkg50NlmXP4Cpvwe+dDJKYWNk4FSPlZn5+1YwDBQDIhIQDNrUVHRv/blEblFylGd5u0TolzMXrZNz0k3g9XjjtEq4ULwXqpbKyF6Su9hvY2rX6YdKcOfr/T/GYZ6Wvfv7FlcogRM9Nd7ASr6BZ9Xx3Uwg6TO8ea3ootvVbfhSNKyXtMqcXUaPV7qNACucywHQsIWaEEW0PRaDuOsbr7T988wfF/f5STYC4loniGJ2w== 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=z1ZpYz8cFW2Vb3qG63+OFoKc2zg/6x1FWuOVFWzS/Tg=; b=ME1vVyn+GdNV/dWgJB85t62CrPcQUNvd8G9r9uEmDTFLiPHmBaaqOhbZlNeXc76VZT9yJA//sh28smkO2IrkA63E9OXDUbpAk4+W7zGDiZT1prVeT6TLKA0jg3LB6RgezVGfnEPOszQpfwLjnWSGVKWkhzh84M6XZ0QAZs+ww7jCr+Vr7cK/7+uJutbQvRlLj/4iIU+nknBvnYv/g0CJ6UXd7weTOoQoMvDMcIzQmLfOVlREZUoAjXWJEuEbGUaw0a+0XU+Y4c648F2ljekDJm7M/BH/kA08frLbICRcPZ5OITDdtmEA5P0kQkCYUPdOYIvutIHeFx5PfuVkInqbnQ== 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 SEZPR04MB7408.apcprd04.prod.outlook.com (2603:1096:101:1a0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.20; Thu, 2 Nov 2023 06:10:26 +0000 Received: from PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::2fd0:f20f:14a9:a95a]) by PUZPR04MB6316.apcprd04.prod.outlook.com ([fe80::2fd0:f20f:14a9:a95a%4]) with mapi id 15.20.6907.025; Thu, 2 Nov 2023 06:10: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" , "jlayton@kernel.com" Subject: [PATCH v1 2/2] exfat: fix ctime is not updated Thread-Topic: [PATCH v1 2/2] exfat: fix ctime is not updated Thread-Index: AdoNUu6tBN2Qe7smSPuW28E/tnlHZw== Date: Thu, 2 Nov 2023 06:10: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_|SEZPR04MB7408:EE_ x-ms-office365-filtering-correlation-id: 2f62afd2-3a90-471c-cc26-08dbdb6a685e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ml/dRMqltVSO3yZnpJxYvbJo39IvmUBehjBNZxsbL1DmXMPwMEGSA/7kaYPJYVxtzQIWlbPQSE9kTa0tkrosu34Ztfuggq9n4gGRpnxBe212d/xeVcy4lBQEY/lyUSd4KOP60fr90t9oAYbpyAITxp+iCxSzEkuptSr6nFCD7Gz71E2NiDBK6NdynbL4LGy6fYk/nbQ552RxWeQPev7r9zcCzjJUwgSksaUf7mGiME0fjxAW8xxDHKACyqz1G5/p5GYxBUWkEedA4TtNUH1kW5f/1rHCJU2pgxTaKyOJz4CmNQHLwaieViR2g/QFVwprzRvZzH7rJTADBDsAxZ3AkKTvk0YMPB3fySp7twkHkvSQrYcSX9uycU2zIY10pH8DcINM7abNotWvZaZ6ntCeiNDt2pRyb7UJjZLlu8XCMyA9a4n0qaGSM5DiC8XFtSDcoVPXhGmWxholDf1GlGF0BQb4j565bukTRJniz0CG4TKIjvELlLRCxLxASueg4DMKR85+N2jWQyeJGcY5UeZG5PG0FBCROr3blHqjSCZcWvuhFJ4Oed46u0k0dnZ5liuxwz0r/sJL/sE2paUC3blb0o7PNDtlCy2UIhZ4Q/CXY3uYWz67GcDO59pXAfh2ChNu 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)(396003)(376002)(136003)(39860400002)(366004)(346002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(110136005)(66946007)(76116006)(9686003)(478600001)(71200400001)(66556008)(66476007)(64756008)(316002)(54906003)(26005)(66446008)(52536014)(8936002)(8676002)(4326008)(83380400001)(55016003)(6506007)(7696005)(5660300002)(15650500001)(2906002)(38100700002)(82960400001)(41300700001)(122000001)(86362001)(33656002)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?othrz++w8w1B3X+6w2ZsHWZNlepW?= =?utf-8?q?2Y3B+h3V6EPfPuxlhLKmBGfLAfqV5mzTp65gDgAc4QaZKdj0U5KSb1E2LULKXh8dt?= =?ut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=?utf-8?q?xBk/Wf8uu06Q4d+F3tQfd1TDPp2MtBv85TzDePfD1htFOvEg5y9udmyI2vMGD/sx1?= =?utf-8?q?5crVaChM91SyHsF9wa7lbFYirznNFNpx1niNY8VpY2hgRjUoFUWHBV4q0ndVZiEW9?= =?utf-8?q?SEYkYKS+MynvE1m25nf2goD6DJ2ssgPeOhzn+9dlh+2xEuzcsjNcVEC9LN5US5tKG?= =?utf-8?q?+W3buSH7jey4+2Kxp1bXgBfA6HsL9+sOqpb65d40+412vDkO/M0B5MOKqwGH0PABH?= =?utf-8?q?/sVqi6Gai5rcg/5GFQRvw0cxd6Uk07vUITxLsu4X+YKtutqNNdIbp5JVyvunl7EAZ?= =?utf-8?q?Q0W4Ye0qNS9KtxZ/0VeYwSLSCcra9FAWNiYUnteZbYVkCPm4m+J0uG/Eb6lUTCd+V?= =?utf-8?q?UyIn4ED4WLRcvdD4wlXZHPtWg22NAaB89giamFj5im4wStq6S2/HwA7hxFTeMzOD6?= =?utf-8?q?l01s2l3D2t8cgFmXAqw3UjPvvMMkjstj5qD7cj4q3aw3rSJyypywCOl1cavFRlmxe?= =?utf-8?q?TQ9Hcl/VIUnoydD5ZsiealgmNeh4BF+c5Wtoc945bB25yB/a3i0+KSRHNmLpskvfU?= =?utf-8?q?QpdAC7e5KNkc?= 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: 36jLU0nbfrdNqJMQ5SFsoPruCukXlVkMdZfQARNQwCBNpAXiqhfo265YjgLHKC494eQAAm2A1xbGKXxa7kLvY5xDjLBpeQtpQuVPSLYKjurgoJWeStsVnWJe1twV+8GkuJMghM/ThlYomGBhxt53PkrT6DaDLkpz6OQx5AcncBpXx56gkUh+o54NbX2cUttSovdfiz23p8vbZFSJGTmUSIAW2R00L362c24yx+swMNX6BUSmypYnF5r8zABvze9VxjQhauV7zttDioMx3LGN4wPgluW8k0wf2j4eLJP3dMBFrlYvUD9lbOtW+cwDWAofgeLc+9fyqFQfLJqoJrAev8noxiCNvyuauwFf4D0claNXhYa89feaVyyWF80R0KTiJb8VtZ93odjhOTxamaBg8dS5jnqrlsHQdjslrAcBp6eVbgScVa/LvuW7VNCjJYNK20pfUaLgjPQ6DOxPx/uwPEM0Ts/s1W4z8FbC3SpFprxz6p0tmqEWxVq6V8XH3wduMtXQ+By+E+YwWAyvGaBw4LUl5KyaphhwWT6wfSuyPOAVd5it4YsOCQKJjpXGBNB5dsC1uc0ZoraFVCE6jpkiCZXQoIVZHmETelZU11sEoFIow4aiZzM9O8tKLhhviU50Wq6mRTQMGW8WcD/xILVVAxLJYSG2nsye9JZc7ov0RP+ievBck1Y3TBEgWhyJEJbxvTHTfeFw+KT7SSUhFQ7trE5SBIMBazZm3vZH0vEVr2VZnK5isMUOqLi/582DaB+hzO9Nq+wKwNyizKqPTCLt/N+XH1ssDkLgrPzBT+hn6a/M0f6UEE3/Kl0Lc2aAvjlwsVQEP+3uqFTxzG52MsgGxjbbwZNZK1dkkzrOrfJgX3QOKmAauXuQhEeSfE+VbIur 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: 2f62afd2-3a90-471c-cc26-08dbdb6a685e X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2023 06:10:26.6913 (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: uF99tjogiedq+5BYcc0LHl9bRkFHDdkc259qQubjL+xTxmb51RtTszMhEMLN8S4rTxRlhGqWkOm1JQ0uCAounw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR04MB7408 X-Proofpoint-GUID: aEGGaplJTeskvJ-9GMQeintlNSn6R3lM X-Proofpoint-ORIG-GUID: aEGGaplJTeskvJ-9GMQeintlNSn6R3lM X-Sony-Outbound-GUID: aEGGaplJTeskvJ-9GMQeintlNSn6R3lM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-01_23,2023-11-01_02,2023-05-22_02 Commit 4c72a36edd54 removed attr_copy() from exfat_set_attr(). It causes xfstests generic/221 to fail. In xfstests generic/221, it tests ctime should be updated even if futimens() update atime only. But in this case, ctime will not be updated if attr_copy() is removed. attr_copy() may also update other attributes, and removing it may cause other bugs, so this commit restores to call attr_copy() in exfat_set_attr(). Fixes: 4c72a36edd54 ("exfat: convert to new timestamp accessors") Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru --- fs/exfat/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/exfat/file.c b/fs/exfat/file.c index 02c4e2937879..bfdfafe00993 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -295,6 +295,7 @@ int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry, if (attr->ia_valid & ATTR_SIZE) inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); + setattr_copy(&nop_mnt_idmap, inode, attr); exfat_truncate_inode_atime(inode); if (attr->ia_valid & ATTR_SIZE) {