From mboxrd@z Thu Jan 1 00:00:00 1970 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 54367C41513 for ; Wed, 2 Aug 2023 18:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691000532; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JwYvvMAg+vbyHHP1Pvcn562D0ia8VGuWeIV/iQkP9oE=; b=DtMXWGtsAkYQrUpYzf4pfM9yEJAgvpHnBPlyu3oXsVGUt8uF2QY0yT+wQ8QLsW4M9/ZThI MQdz2rV4SEbCt7+R+GVsSpsWsH2yzyfHulEwHiDOPMbFYYIkIh9gcWJ6RIrHQr2XnitLxE QP/+RZ1g3byC/5lWoyePwCsiuS2X9ss= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-508-ARM0nQ5dNk2qy7QKqH7IHg-1; Wed, 02 Aug 2023 14:22:05 -0400 X-MC-Unique: ARM0nQ5dNk2qy7QKqH7IHg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8ADCC38008B4; Wed, 2 Aug 2023 18:22:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 757E11121325; Wed, 2 Aug 2023 18:22:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 51E051946A75; Wed, 2 Aug 2023 18:22:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EEF331946A45 for ; Wed, 2 Aug 2023 18:22:02 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D21D1112132E; Wed, 2 Aug 2023 18:22:02 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9FB91121325 for ; Wed, 2 Aug 2023 18:22:02 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A6B6A100813A for ; Wed, 2 Aug 2023 18:22:02 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-319-yVgcqUIOOqWN9dxxwryclA-1; Wed, 02 Aug 2023 14:21:59 -0400 X-MC-Unique: yVgcqUIOOqWN9dxxwryclA-1 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 1C9E261A88; Wed, 2 Aug 2023 18:21:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51C95C433C8; Wed, 2 Aug 2023 18:21:50 +0000 (UTC) Message-ID: <16f46a9e6d88582d53d31a320589a7ba9d232e0c.camel@kernel.org> From: Jeff Layton To: "Darrick J. Wong" , Christian Brauner Date: Wed, 02 Aug 2023 14:21:49 -0400 In-Reply-To: <20230802174853.GC11352@frogsfrogsfrogs> References: <20230725-mgctime-v6-0-a794c2b7abca@kernel.org> <20230725-mgctime-v6-5-a794c2b7abca@kernel.org> <20230802174853.GC11352@frogsfrogsfrogs> User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Subject: Re: [Cluster-devel] [PATCH v6 5/7] xfs: switch to multigrain timestamps X-BeenThere: cluster-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: "\[Cluster devel\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Latchesar Ionkov , Martin Brandenburg , Konstantin Komarov , linux-xfs@vger.kernel.org, Dominique Martinet , Christian Schoenebeck , Dave Chinner , David Howells , Chris Mason , Andreas Dilger , Hans de Goede , Marc Dionne , codalist@coda.cs.cmu.edu, linux-afs@lists.infradead.org, Mike Marshall , Paulo Alcantara , linux-cifs@vger.kernel.org, Eric Van Hensbergen , Miklos Szeredi , Richard Weinberger , Mark Fasheh , Hugh Dickins , Tyler Hicks , cluster-devel@redhat.com, coda@cs.cmu.edu, linux-mm@kvack.org, linux-f2fs-devel@lists.sourceforge.net, Ilya Dryomov , Iurii Zaikin , Namjae Jeon , Trond Myklebust , Shyam Prasad N , ecryptfs@vger.kernel.org, Kees Cook , ocfs2-devel@lists.linux.dev, Anthony Iliopoulos , Chao Yu , Josef Bacik , Tom Talpey , Tejun Heo , Yue Hu , Alexander Viro , linux-mtd@lists.infradead.org, David Sterba , Jaegeuk Kim , ceph-devel@vger.kernel.org, Xiubo Li , Gao Xiang , OGAWA Hirofumi , Jan Harkes , Christian Brauner , linux-ext4@vger.kernel.org, Theodore Ts'o , Joseph Qi , Greg Kroah-Hartman , v9fs@lists.linux.dev, ntfs3@lists.linux.dev, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, Ronnie Sahlberg , Steve French , Sergey Senozhatsky , Luis Chamberlain , Jeffle Xu , devel@lists.orangefs.org, Anna Schumaker , Jan Kara , linux-fsdevel@vger.kernel.org, Andrew Morton , Sungjong Seo , linux-erofs@lists.ozlabs.org, linux-nfs@vger.kernel.org, linux-btrfs@vger.kernel.org, Joel Becker Errors-To: cluster-devel-bounces@redhat.com Sender: "Cluster-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable On Wed, 2023-08-02 at 10:48 -0700, Darrick J. Wong wrote: > On Tue, Jul 25, 2023 at 10:58:18AM -0400, Jeff Layton wrote: > > Enable multigrain timestamps, which should ensure that there is an > > apparent change to the timestamp whenever it has been written after > > being actively observed via getattr. > >=20 > > Also, anytime the mtime changes, the ctime must also change, and those > > are now the only two options for xfs_trans_ichgtime. Have that function > > unconditionally bump the ctime, and ASSERT that XFS_ICHGTIME_CHG is > > always set. > >=20 > > Signed-off-by: Jeff Layton > > --- > > fs/xfs/libxfs/xfs_trans_inode.c | 6 +++--- > > fs/xfs/xfs_iops.c | 4 ++-- > > fs/xfs/xfs_super.c | 2 +- > > 3 files changed, 6 insertions(+), 6 deletions(-) > >=20 > > diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_= inode.c > > index 6b2296ff248a..ad22656376d3 100644 > > --- a/fs/xfs/libxfs/xfs_trans_inode.c > > +++ b/fs/xfs/libxfs/xfs_trans_inode.c > > @@ -62,12 +62,12 @@ xfs_trans_ichgtime( > > =09ASSERT(tp); > > =09ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); > > =20 > > -=09tv =3D current_time(inode); > > +=09/* If the mtime changes, then ctime must also change */ > > +=09ASSERT(flags & XFS_ICHGTIME_CHG); > > =20 > > +=09tv =3D inode_set_ctime_current(inode); > > =09if (flags & XFS_ICHGTIME_MOD) > > =09=09inode->i_mtime =3D tv; > > -=09if (flags & XFS_ICHGTIME_CHG) > > -=09=09inode_set_ctime_to_ts(inode, tv); > > =09if (flags & XFS_ICHGTIME_CREATE) > > =09=09ip->i_crtime =3D tv; > > } > > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c > > index 3a9363953ef2..3f89ef5a2820 100644 > > --- a/fs/xfs/xfs_iops.c > > +++ b/fs/xfs/xfs_iops.c > > @@ -573,10 +573,10 @@ xfs_vn_getattr( > > =09stat->gid =3D vfsgid_into_kgid(vfsgid); > > =09stat->ino =3D ip->i_ino; > > =09stat->atime =3D inode->i_atime; > > -=09stat->mtime =3D inode->i_mtime; > > -=09stat->ctime =3D inode_get_ctime(inode); > > =09stat->blocks =3D XFS_FSB_TO_BB(mp, ip->i_nblocks + ip->i_delayed_bl= ks); > > =20 > > +=09fill_mg_cmtime(request_mask, inode, stat); >=20 > Huh. I would've thought @stat would come first since that's what we're > acting upon, but ... eh. :) >=20 > If everyone else is ok with the fill_mg_cmtime signature, > Acked-by: Darrick J. Wong >=20 >=20 Good point. We can change the signature. I think xfs is the only caller outside of the generic vfs right now, and it'd be best to do it now. Christian, would you prefer that I send an updated series, or patches on top of vfs.ctime that can be folded in? =20 --=20 Jeff Layton