From patchwork Wed Jul 5 19:00:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116377 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097311vqx; Wed, 5 Jul 2023 12:44:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlGnLjxhj+veLi6wnTd8/SmJLShkxAXFxZMwe+9Sp/T9DfVG1WKagKUG3dyfi8d8SDlvuJJO X-Received: by 2002:a05:6a00:2383:b0:682:3120:1450 with SMTP id f3-20020a056a00238300b0068231201450mr22285993pfc.30.1688586269324; Wed, 05 Jul 2023 12:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586269; cv=none; d=google.com; s=arc-20160816; b=imgmAV0CKuxCJXqFOGn8CZ9Jd5+eq6+yMJ1pFi9I3NQpzrx3sbfmqXKMGCY+bKU+JT I6yDD66DEpBKD5DrCvdxhaGNZm683Huenao4POYATkeTmEyUbUz3dKIZLy1Sz7BP/xNK koxV0TBX2gJCkrAUKySopFg5lp1HTZ0HhbFXUAY7emv8PyYwMGbC0qCWLjkFSNTluoWg 0bcM8E8mfhDhV4QsgMqSDx5+h9iVOzax4DOmE+w3KaJfox/WzolwVVitJklBu6mZjmjx 6VdSSTiAJHtlQbIpc8mfFKxuoOjzxBbmyZ3um7GI8KegvDSMtRsetmGNUBU1cAMa+pus sXMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dijRCGJ7wEiaVvOKI/kUzn8r5ldTe/owd4sFfXYL27s=; fh=Nk/0tMRLb8D+wJo4Zmm3v7/GPXN2K9PAwHUJV3gzhLs=; b=gjmUKutmZUqGLvDtk6t9VFLqyMEPleR1Kvz9vYWOo+B+ODFZ3PvS4tQu4USAOEqAzs JvoAVtLeJ4DkORoHCLJqcdczc50XasLA9R+3xeZD96ZBIpSBMtVQ3KymOk5Y49mNdBA5 F+On+59+Pcva0sqN+SoP/aFwDQWwvWjootk0gkGcF9O+GfZ0VyyEoqLmN6DS3p5M77BR aWjFgVuDmkKsCFlLJbP2Kxny9LE9A3Q+4OSzgHqK9EyQ4BIdLUoi1kzgqF9zrV1TtZl7 sBDDsm8WKYDuD+CxKqub/eRWV5jn+z1h/dIYuvIu2iW+DWjFr/ee9pK2DmCWg2H/XhWH svxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BwjgVC7C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ct8-20020a056a000f8800b006796dca10d3si19706741pfb.100.2023.07.05.12.44.14; Wed, 05 Jul 2023 12:44:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BwjgVC7C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233463AbjGETD0 (ORCPT + 99 others); Wed, 5 Jul 2023 15:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233396AbjGETDS (ORCPT ); Wed, 5 Jul 2023 15:03:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90EFC1985; Wed, 5 Jul 2023 12:03:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2E845616EF; Wed, 5 Jul 2023 19:03:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DED71C433C8; Wed, 5 Jul 2023 19:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583795; bh=C29zaLc0+YewpaXSEH0HW42gKnjE7YUcBZ4P7Z6b8Hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BwjgVC7Cbh9HQG2vDydlZGjLCZkcX1Ds3CLZ61K/xriTZaI/1UBNBiDzxP+g/dIZB Z1b9xp3sy523k6IzA0saIP3vpzd2L1B4S325qj1QrjG92VPEgqhl6mxOiyELZ2DqM8 OREJCtRhqTLktGuNCrpzYO/VV2b9RmtMCTbA6+UzGIMzOwW9Iel67mauV7xvmtiGiM McJ3467i8G17Xwv2uQ1SP2RdJGHk3OTuiK55GkB144F4uQV8kGRbZme9vY+WHZ6hww 9lU1DH4+FoNn400oj2U5B9F2VN6u9FxOY28tE9cjuCXHgVDa4fPKe/PQZDbGfgcPfh GlYx1XFDP2Qog== From: Jeff Layton To: Christian Brauner , Namjae Jeon , Sungjong Seo Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 04/92] exfat: ensure that ctime is updated whenever the mtime is Date: Wed, 5 Jul 2023 15:00:31 -0400 Message-ID: <20230705190309.579783-4-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611035954777957?= X-GMAIL-MSGID: =?utf-8?q?1770611035954777957?= When removing entries from a directory, the ctime must also be updated alongside the mtime. Signed-off-by: Jeff Layton --- fs/exfat/namei.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index e0ff9d156f6f..d9b46fa36bff 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -817,7 +817,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) ei->dir.dir = DIR_DELETED; inode_inc_iversion(dir); - dir->i_mtime = dir->i_atime = current_time(dir); + dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir); exfat_truncate_atime(&dir->i_atime); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); @@ -825,7 +825,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) mark_inode_dirty(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = current_time(inode); + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); exfat_truncate_atime(&inode->i_atime); exfat_unhash_inode(inode); exfat_d_version_set(dentry, inode_query_iversion(dir)); @@ -979,7 +979,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) ei->dir.dir = DIR_DELETED; inode_inc_iversion(dir); - dir->i_mtime = dir->i_atime = current_time(dir); + dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir); exfat_truncate_atime(&dir->i_atime); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); @@ -988,7 +988,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) drop_nlink(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = current_time(inode); + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); exfat_truncate_atime(&inode->i_atime); exfat_unhash_inode(inode); exfat_d_version_set(dentry, inode_query_iversion(dir));