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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 12950C001DF for ; Wed, 2 Aug 2023 18:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:Cc:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=H5ZVNNQND/vwb3XoYWs7ramwz/g8iaWxtM0rH/tmKNI=; b=jmH8/i3gMJPHLA 7WJNRP8opOHSPoQYaYkesR4x/n8Nb3vXjCBIPeOzkTkj8y/Cn2CH6DpNlwdswJ+7LB1Ada7oiIWIc g948mv0tXyfbNToWIYj1s7kjCcsP7v5r/+YRz8HhPvjQljmfIEwG+iAGVQhzdwcFranmG/sAtpuIC apwfTON9dGxVU3oGNHiAMwtMGtqAjEoB6Jwo5egwIGkg03/GSyqWompIB2GQhIqALh/0E+5jY7lWV f2fFNqr9WZRs0vNJhjZCOr2DcmhjmVQxE3h9ygSH2fCkva66hZ4W8blI7Y73avWE8qAQ8ptL/my/M 3f7g8hQBvCiKaiMy9uLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRGTx-005dAK-1u; Wed, 02 Aug 2023 18:22:01 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qRGTu-005d9J-1I; Wed, 02 Aug 2023 18:21:59 +0000 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691000516; bh=ycwx/5PKSOfdsJleD1GrXVU/2tvqnKBKqdlrqiXz2a4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Lq45skxqh7cpBQLhcIe1Gw+lovpqkvSzuzb8uAcyF5FrElk/i/Ef62Ff+U85B0JYe gb5CgOGTY1TKw/GZkOMcRDcxztlWQJmGUpbe2PB0ZZtJhOtSfNtibfRZFTg6XykiV4 x4PKksy3wl2+3UvlwVruRvycuEHFr6v641nEPFf7oKydUHdevtCfIP62s3qFywogxs bUSv3T3yZ3RUK3kjfZ3Erjub/WKAY+sdkcU6WTTdHAgJrOMM/i9gdSpZrws8Unwtrq tNeLRJIXs/0bUybd4cEYmTQYz1K0b/J8KC16T4R6xltE9tlCNFzbPuAaxgMh/CIZB5 7bXA8nQ4jZd1w== Message-ID: <16f46a9e6d88582d53d31a320589a7ba9d232e0c.camel@kernel.org> Subject: Re: [PATCH v6 5/7] xfs: switch to multigrain timestamps From: Jeff Layton To: "Darrick J. Wong" , Christian Brauner Cc: 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 , Christian Brauner , 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230802_112158_527733_571A16C5 X-CRM114-Status: GOOD ( 22.87 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org 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? -- Jeff Layton ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/