Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1851423rwo; Thu, 3 Aug 2023 00:11:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlHom68/L7sXa+vbDfJqvEeaSextc7YzUvdpENiGwpRN9Pg0QyDyk2/ioq+QpQX67VCm63SU X-Received: by 2002:a17:906:51d0:b0:99b:ce6d:fc90 with SMTP id v16-20020a17090651d000b0099bce6dfc90mr10200484ejk.2.1691046671891; Thu, 03 Aug 2023 00:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691046671; cv=none; d=google.com; s=arc-20160816; b=zRSJH0XFu5tTaycXaGzPlHD+1oB2zssaXlJJvBHASBAB5oqiC3aq8iRiN4C9ZI5gdt 8fhTehbPetQzFDktXKiDgHf5yYKFFRAdgrMo85bnaQ8WIKvDbtcSb1H8kckLo4NIEY1L TxAHXSEi4mmK6dSAWXG9+z6rkJmCnB4EFpxF7l/cC7acgcifRPhCU6cW+RvtRx34BekL JBmAg2WpZhVV4IsNu1h4+UyIjluyVEejM3adJFeMMerZAFtW2L+kkm2j1UsXZIT/KwFi 6zarbfq2llljXOIzvUGaw78C3ooHuLdHlc0kf6hGlkgDnRXE7lCOMOb5tr40EAOTG5x4 JAbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NOZI/l3L3KOSwr33UWCYkZpjITeZur6tmYRYTjntZV0=; fh=5etFpycuXFMgrNKrh7GpohJYDGNeuqsvpIkg9J1PI0A=; b=u1GmoqZoKW1cEN1OjxI5s8Wprdg+5igJESqx+plHM9MkWM7UCEC8J1wM3Raq4Wpfus WElqt8GPEqM49Myx2qjv0YnxhGDZ+WNe5sKB8VtaBK+FYR4K8xu6LyOKiWpgcx+f1HjD YX69apXin11ozBAGISytM5jW1N+O41ftwtr2I7Yu0ZJ247S9aAtoXQsXitFFi0TKg+Yx DYXy45fGvlXpBh4tWJpj2ch6vQX4R0xd5N1BeQ/iM1LKIVULiwM2JC774VBi8nyLL2mf i8yOOzCMkrFmJYbQs+tfdXz4i97xixSP6ifO1rDga6pRm39g14zAcCB2W/gvAIA5iOz0 emoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K7UhWAmH; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p15-20020a1709061b4f00b0099bc29dd540si5375987ejg.172.2023.08.03.00.10.45; Thu, 03 Aug 2023 00:11:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=K7UhWAmH; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 S231700AbjHCHGn (ORCPT + 99 others); Thu, 3 Aug 2023 03:06:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbjHCHGS (ORCPT ); Thu, 3 Aug 2023 03:06:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03CDC1716; Thu, 3 Aug 2023 00:06:14 -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 9328061C1D; Thu, 3 Aug 2023 07:06:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B8B8C433C7; Thu, 3 Aug 2023 07:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691046373; bh=q5HEh93m22+IZ7gJ0ht4CIPca9ZIugEYnaPvq20Gjuc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K7UhWAmHViQApxb4uEFZrC7NgM4L98YWGA8RqmJSuKws6QfloHZYz2gu1jyPObkgz rJxDzSRQnw1K4pXJOSbYSQwEHQGHEgpocuMnPLyGqXwysQNLhUfpr9nXqz/I7vEWHU Xyq0E7GBSXm+tlg7gDzjWZJiiMF3px3+dfpcHG121egWkUzTPQBnCY0uSqoCY/0Kr0 ZBpFxVuNI9TULQg5bdi3e7SZRLX5rY79l7KLMQCUVHdnr6WpsAje202RHEqOcZVFgo 7miM6YWTEiuxqRbsDMbuOSLOG9Nu93OzU+EfWoCfeFibJ4Z6IjLTxS3vlPbG54qPVW uZsk7io+itqAw== Date: Thu, 3 Aug 2023 09:05:55 +0200 From: Christian Brauner To: Jeff Layton Cc: "Darrick J. Wong" , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Howells , Marc Dionne , Chris Mason , Josef Bacik , David Sterba , Xiubo Li , Ilya Dryomov , Jan Harkes , coda@cs.cmu.edu, Tyler Hicks , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Namjae Jeon , Sungjong Seo , Jan Kara , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , Greg Kroah-Hartman , Tejun Heo , Alexander Viro , Trond Myklebust , Anna Schumaker , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , Mike Marshall , Martin Brandenburg , Luis Chamberlain , Kees Cook , Iurii Zaikin , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Sergey Senozhatsky , Richard Weinberger , Hans de Goede , Hugh Dickins , Andrew Morton , Dave Chinner , Anthony Iliopoulos , v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, ecryptfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, devel@lists.orangefs.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-mtd@lists.infradead.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org Subject: Re: [PATCH v6 5/7] xfs: switch to multigrain timestamps Message-ID: <20230803-mulmig-rennen-adbe9b2a6608@brauner> References: <20230725-mgctime-v6-0-a794c2b7abca@kernel.org> <20230725-mgctime-v6-5-a794c2b7abca@kernel.org> <20230802174853.GC11352@frogsfrogsfrogs> <16f46a9e6d88582d53d31a320589a7ba9d232e0c.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <16f46a9e6d88582d53d31a320589a7ba9d232e0c.camel@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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-ext4@vger.kernel.org On Wed, Aug 02, 2023 at 02:21:49PM -0400, Jeff Layton wrote: > 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. > > > > > > 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. > > > > > > 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(-) > > > > > > 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( > > > ASSERT(tp); > > > ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); > > > > > > - tv = current_time(inode); > > > + /* If the mtime changes, then ctime must also change */ > > > + ASSERT(flags & XFS_ICHGTIME_CHG); > > > > > > + tv = inode_set_ctime_current(inode); > > > if (flags & XFS_ICHGTIME_MOD) > > > inode->i_mtime = tv; > > > - if (flags & XFS_ICHGTIME_CHG) > > > - inode_set_ctime_to_ts(inode, tv); > > > if (flags & XFS_ICHGTIME_CREATE) > > > ip->i_crtime = 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( > > > stat->gid = vfsgid_into_kgid(vfsgid); > > > stat->ino = ip->i_ino; > > > stat->atime = inode->i_atime; > > > - stat->mtime = inode->i_mtime; > > > - stat->ctime = inode_get_ctime(inode); > > > stat->blocks = XFS_FSB_TO_BB(mp, ip->i_nblocks + ip->i_delayed_blks); > > > > > > + fill_mg_cmtime(request_mask, inode, stat); > > > > Huh. I would've thought @stat would come first since that's what we're > > acting upon, but ... eh. :) > > > > If everyone else is ok with the fill_mg_cmtime signature, > > Acked-by: Darrick J. Wong > > > > > > 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? Let's fold instead of inundate everyone with almost 100 patches. When I'll apply I'll remind everyone where the series can be pulled from anyway.