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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CDA6CF31AC for ; Wed, 2 Oct 2024 09:14:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 632836B0320; Wed, 2 Oct 2024 05:14:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E20C6B0327; Wed, 2 Oct 2024 05:14:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45B8F6B0320; Wed, 2 Oct 2024 05:14:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 1A5F46B0318 for ; Wed, 2 Oct 2024 05:14:11 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7DD74161D5D for ; Wed, 2 Oct 2024 09:14:10 +0000 (UTC) X-FDA: 82628100660.03.D2B03BD Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf13.hostedemail.com (Postfix) with ESMTP id 135A320008 for ; Wed, 2 Oct 2024 09:14:07 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=KVecqr+N; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=vBYEfZoW; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=KVecqr+N; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=vBYEfZoW; spf=pass (imf13.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727860278; h=from:from: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ciY4s211AtNsmLMEFppWW09ynC9Vd3xoRhyo0YMhjdc=; b=ACfjxc2SHWfmR8Dhg0AEMr+8psBMp3n2ad0YmE+7FXUfSGacbO3l/KmDNRN3WoCBXklqLg ozgSKMSGUt3ogXoD6t4EPkJ1m9/3BvJd5p92uzKZDe6Cmbij/sKo8RYkHr3bBE7rG/NKNb UPirbD4LetfpTSUfysThunxpndt2sBE= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=KVecqr+N; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=vBYEfZoW; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=KVecqr+N; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=vBYEfZoW; spf=pass (imf13.hostedemail.com: domain of jack@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727860278; a=rsa-sha256; cv=none; b=RiDUwgvxF7yebp5s4sg4G8qGrbOubtboAnKA5whYXKYsmAaS2LBiReVLpHumOoTRgo54qv N9SIKDsJNdFK/I34UL3e8iTQ69hk9i+Xu5vFQIEcLj8Jk7Njm3stoIEeZQEP10Z1s40rDF s/yRmHDus3fYa19+wTfZLHNE81WIQ1w= Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3042721B70; Wed, 2 Oct 2024 09:14:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1727860446; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ciY4s211AtNsmLMEFppWW09ynC9Vd3xoRhyo0YMhjdc=; b=KVecqr+NBI1yiYx1BRcvKKnoyXIivh15+piF+YZyiWfrDIRo6SsuQJrxd8RL6jhFpnJG3g bXyd/69TLuagh7zkintkdg6FnyOvc8kIouzsWt4Uad7lwiaHv6mwQM+0iwyXWjl4MXpXU1 4xUac63Ufy/zn/WHxi5yMhRCoLEzkNw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1727860446; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ciY4s211AtNsmLMEFppWW09ynC9Vd3xoRhyo0YMhjdc=; b=vBYEfZoWDP05pmDCLOTbylMr+FqLkg7Ki23XcVZOBFd4msaAsoqBKQbkafeu2FG7KWktRV 3NqfRi0Nn6eFECAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1727860446; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ciY4s211AtNsmLMEFppWW09ynC9Vd3xoRhyo0YMhjdc=; b=KVecqr+NBI1yiYx1BRcvKKnoyXIivh15+piF+YZyiWfrDIRo6SsuQJrxd8RL6jhFpnJG3g bXyd/69TLuagh7zkintkdg6FnyOvc8kIouzsWt4Uad7lwiaHv6mwQM+0iwyXWjl4MXpXU1 4xUac63Ufy/zn/WHxi5yMhRCoLEzkNw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1727860446; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ciY4s211AtNsmLMEFppWW09ynC9Vd3xoRhyo0YMhjdc=; b=vBYEfZoWDP05pmDCLOTbylMr+FqLkg7Ki23XcVZOBFd4msaAsoqBKQbkafeu2FG7KWktRV 3NqfRi0Nn6eFECAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1FA9613A6E; Wed, 2 Oct 2024 09:14:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 4XuwB94O/WYUSwAAD6G6ig (envelope-from ); Wed, 02 Oct 2024 09:14:06 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 8280EA08CB; Wed, 2 Oct 2024 11:14:05 +0200 (CEST) Date: Wed, 2 Oct 2024 11:14:05 +0200 From: Jan Kara To: Jeff Layton Cc: Jan Kara , John Stultz , Thomas Gleixner , Stephen Boyd , Alexander Viro , Christian Brauner , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Jonathan Corbet , Randy Dunlap , Chandan Babu R , "Darrick J. Wong" , Theodore Ts'o , Andreas Dilger , Chris Mason , Josef Bacik , David Sterba , Hugh Dickins , Andrew Morton , Chuck Lever , Vadim Fedorenko , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v8 02/12] fs: add infrastructure for multigrain timestamps Message-ID: <20241002091405.7b2s4qvoaqrn3l4f@quack3> References: <20241001-mgtime-v8-0-903343d91bc3@kernel.org> <20241001-mgtime-v8-2-903343d91bc3@kernel.org> <20241001132027.ynzp4sahjek5umbb@quack3> <7761de29d15df87a29575de57554b56a91ae55a0.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7761de29d15df87a29575de57554b56a91ae55a0.camel@kernel.org> X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 135A320008 X-Stat-Signature: hbeddsd1q5hzk64q7gbzg4jx4twt9rts X-Rspam-User: X-HE-Tag: 1727860447-474676 X-HE-Meta: U2FsdGVkX1+jb5+zuHcfOcpykFWzedznQLYVXFbS9uQIvDpIo3pvIuEvn3FdXrDXdjoE7GCU7LEn0BYXHTCRn6FTfNZ4RpmrlI1C337z07n1lr9cr3QDOsILmaf9zxnQ2sjkfDP+66/j3yISeJ0DcMZCywrvFr/VFvNQshBdjjtpqNjWzf0rnzop+l9rD9eQna8636KBmD5TfM/5YIwmCq78swt/A2OXJC+E/+lJv+obwc+IeYfu+qbsR91ypBB5yRIcbNLMCeeBzz9tJcAAzL5XRR5B2GiGTJprECPjMNY+1rwApL5iXzP/oCH/m0YaFdUnvfcHKn/HDtJDxVx6lFzSCmtaVk9blCSWMpMe5lwlbAU+YmAuEVb8TTbRuPCyrrw5VBKPZ3RuzOWS7pN/GS/mknxUxfDHi5ouvDktyqGwQP9xDGT3MGHGEYO8kg141GrAf//gjctyNUtT3s/6mRZBRWXyaj32/I4Jvmz5LiUkwrJtaug/XSDStFoiY//vHcy/RD89/sM1HJjNrBQlK7cP9zZx8Aq8l+vPZfEAO9K7ozzbEe/TOrG5VNKXu5Dg9bQvaaU4GS29uO+HFWdv6o3EFvdwx18QbFNT8om6eJEm4ICyf5Z6artXE4Is+FpDwlup0OBvHEeDv66eCKFdgz2Iljtm21KsX8vNMTgiwM2FrcWozJgf8TMjZj3lSa2DqT/g3w5muiTV7XEbs6PEuaTesR4wmPJV8SgpyrBqDzLa+Iw6/ss/1UpFruje2Cq/TQC6R6xKv0fQ9hvb70+LRyWHGuZ9RSIdcpprsdlOY4DCpC+ZhlnXSW0NlLLfCkbNEan6SBhL4RQrhYmhdzDGfXr0YPSudOgnESmiceBsMiVO7vgAd/sVvpgCab78jnadbJxqQoVsxieqhB5npHR0j52PGHXrKGo7AVw+ZfB6lHSNzrDTkO4rOP97ezB9X2bZwRc41qms5xxcivQuHMd RPHdh0uH uXZjoHxZmcMtfRGeLL4GBto95mhVl9v1/JP3edWBiQKkYA8Bs7QJiG7mIA2L9vsJQfaALYTS3tuMRKP8x/1PtQL3Zdvc+beACRNvaIqDXKtKmKI6Rqth+tAK08aAv+kgPD5lzmev1P1J+fZ1r80bMUTwGRaQOQkOFuq4kfMsn/OXnBZOqjd6u2JvLACthbLtWasJ0neI48TCQXnZ7rmc6JT/ahDAGzuNeSe5dYl8DFCo5DGD0+HHzLK+VROThcd2BVnCSy6D4V3YrSpJDPoRd3C1q5vlXbltxL+NWkm2PWtzyS3NsRSmXybjEVxZ2aP+FHX6b3piIkcLWLsa5+0DIr5LCHg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue 01-10-24 09:34:18, Jeff Layton wrote: > On Tue, 2024-10-01 at 15:20 +0200, Jan Kara wrote: > > > diff --git a/fs/stat.c b/fs/stat.c > > > index 41e598376d7e..381926fb405f 100644 > > > --- a/fs/stat.c > > > +++ b/fs/stat.c > > > @@ -26,6 +26,35 @@ > > > #include "internal.h" > > > #include "mount.h" > > > > > > +/** > > > + * fill_mg_cmtime - Fill in the mtime and ctime and flag ctime as QUERIED > > > + * @stat: where to store the resulting values > > > + * @request_mask: STATX_* values requested > > > + * @inode: inode from which to grab the c/mtime > > > + * > > > + * Given @inode, grab the ctime and mtime out if it and store the result > > ^^ of > > > > > + * in @stat. When fetching the value, flag it as QUERIED (if not already) > > > + * so the next write will record a distinct timestamp. > > > + */ > > > +void fill_mg_cmtime(struct kstat *stat, u32 request_mask, struct inode *inode) > > > +{ > > > > Given how things worked out in the end, it seems this function doesn't need > > to handle mtime at all and we can move mtime handling back to shared generic > > code? > > > > I don't think we can. The mtime is effectively derived from the ctime. > > If I query only the mtime, I think it's reasonable to expect that it > will change if there is another write, even if I don't query the ctime. > We won't get that unless we can also set the flag in the ctime when > only the mtime is requested. Aha, right. I already forgot about this :). Can you please add to the comment the above explanation so that we remember next time somebody wants to "clean this up" like me ;)? Thanks! Also feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR