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 3309FEE57F1 for ; Fri, 8 Sep 2023 10:42:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4145B6B00AE; Fri, 8 Sep 2023 06:42:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C3AE6B00AF; Fri, 8 Sep 2023 06:42:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 28AB66B00B0; Fri, 8 Sep 2023 06:42:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 19D0A6B00AE for ; Fri, 8 Sep 2023 06:42:34 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D42C4121039 for ; Fri, 8 Sep 2023 10:42:33 +0000 (UTC) X-FDA: 81213091386.29.F690C6A Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf04.hostedemail.com (Postfix) with ESMTP id 00BBE40019 for ; Fri, 8 Sep 2023 10:42:31 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=E2XPOzAd; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=FoUYrRLe; dmarc=none; spf=pass (imf04.hostedemail.com: domain of jack@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jack@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694169752; 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=aUQKt/H3ZP7ajcYBxY10gBBVeTKZFcXnIqtiBFBJ8L8=; b=HGtszt9LNU387xAeXYgV736g65nPDb4ZFbVW8fiG7dsulGnrCSi2VD3FOo/HxDINSVCQ++ QTCKMzjd0tmpCIc7snhSCvo6AcyGMFOybxpiIqsWSoAae9rXIakxav0ZBNKX51NWfuov4u bnH7dQIcpuheTzP3N6wliNkPAdzbD+M= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=E2XPOzAd; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=FoUYrRLe; dmarc=none; spf=pass (imf04.hostedemail.com: domain of jack@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jack@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694169752; a=rsa-sha256; cv=none; b=dZlPLuL0Y41Md9ioU3bso3SaS9KOjlVG7Hr9+t7TMU5XPvXvGtTyul4OKzD2w4jL12pMX8 pA451dSxzlMZUM3XzmnoNDcmizAW9NtToP0ehnURCHei1z9fJbowEahW0VXsTf3B4YemzG sP2cPy6hmY8PvkFktKSgdcKweJuH0Xc= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9BB111FD95; Fri, 8 Sep 2023 10:42:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1694169749; 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=aUQKt/H3ZP7ajcYBxY10gBBVeTKZFcXnIqtiBFBJ8L8=; b=E2XPOzAd2/wOYuRyPXwWksDqPCtj539n3ttrPi6iyeICdPf1vGuUZa3luzUOgR62kdbBK2 J2nmjukT1qV5D3EOXuWHPAKsdLSC1ru7cth8m1aftFMSPuP1VsIFv82yhBLmkb7tj+2yDI 1YRhhA7ydKp3HRVGefMJfVuTvJJ4vn8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1694169749; 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=aUQKt/H3ZP7ajcYBxY10gBBVeTKZFcXnIqtiBFBJ8L8=; b=FoUYrRLeeDvFNKS70jwXnA7nGxBlsrV/U1fU8qL75SGW2EKBe2eDarsVDOftbChvHSR5X1 USiYjLuV5gPwZBDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8D768131FD; Fri, 8 Sep 2023 10:42:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 3Q6CIpX6+mSafQAAMHmgww (envelope-from ); Fri, 08 Sep 2023 10:42:29 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 31D20A0774; Fri, 8 Sep 2023 12:42:29 +0200 (CEST) Date: Fri, 8 Sep 2023 12:42:29 +0200 From: Jan Kara To: Jeff Layton Cc: Alexander Viro , Christian Brauner , Jan Kara , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH 1/2] fs: initialize inode->__i_ctime to the epoch Message-ID: <20230908104229.5tsr2sn7oyfy53ih@quack3> References: <20230907-ctime-fixes-v1-0-3b74c970d934@kernel.org> <20230907-ctime-fixes-v1-1-3b74c970d934@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230907-ctime-fixes-v1-1-3b74c970d934@kernel.org> X-Rspam-User: X-Stat-Signature: i7gszh3snrne674gyfb84fzfh94qu1cr X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 00BBE40019 X-HE-Tag: 1694169751-239904 X-HE-Meta: U2FsdGVkX1+q52Zfg/5QA1mF1seK9zMpU+EAHUMZHT6DXdjV8E1NZa810Tdmdu68QVQzzdsQqa9KsEb+UdVYzelIX8d+Fa+wAKZ5b63nnPn2RwWt7c7Ljk2TEcYh0Cjk0UIskr3/rx0Cmb8koHTewdFf9XIxM4YgmvRPM0y+Yua0w+rB9ouLvBfz67PU25hqLJOsN4UPUdRZc0i1V/SsRScZGLFgoinb0LbCfY4VdyPJP03+/zY9Tv2mj4pGWu4RN3Cqc+DyfYakm2vZRTz67WQKYtSSlM2k+x4V4Z6kQtMhAHzHZgu3demV/dRb+y6wP463zqNl1S2izQWA63L8EeHYW0dL6PkGsqchChV67fTqWnx2ufpbuEyLfHscuvwqte79/DV4FwJ1YWjYad0VCmtMB2P7taXDbbRdUOL/ID/de0c7g88wcJISf/7nZiLFzZq0N1ygGM7lDGZIjGPG8vbzVuTN+I6+gd1HMDChhBxpD4aSjiQuwtOMjKopWdTtzakQwDF3UrTHIdnT8G1D86FQ3sCO32SBJZwF+4fHhQhOc7udUoCfHd3zKk5saGUr38piAkiJm4g5bXxMDqmZXLmd+WvpYmUzuVxdb7v/zCWMW+ijfrCGejXCa0YrILZAtk175tnopSCH/C5+9q3QlOfoFsROT02hexGflIQbAI/fAlls8sKTiS0mubnGU8ZOTSh7kujJ20R2iR9YGR0g6arvwDloKZbnsdJqw+Pge5Ng4gvtAKh+wI0xtJBK0w/u7jqgyFba7CflQpV+d14ArEDPo8lGrH25JcqVlX14Rp21BorMvDsD8r0NVP+XoxaGdR8z5DgJnMwKbxvyIuNuchnwWogWZTSdPcy6+BciXvSE1VyqbHMNRoNAX2GWAVmWi3qyk9UhajAYgC9MQG9HqzFvuZIvp/epK7jxUsRTilwaw6QJGYdZAaBrDBEq2AnJA4n6lZm2PXlZcXRB+Ox ZjSnqwAh sQD4aUvfA8u2hAKHhLlRR1PSawQH61Wq2y6avSc3ZrKhqJD5iNPVDCaaiWgcZMcsgLSx6phCknY4583UX5Z286ORbLevrsEmPMDFZ//n0we64GzC6AufrBEktkbsfMBsib2KzO8f2KdDQpo4/SY27x9r2h5CGQgqfWY39tTaVZRifrARr0PlU05bSgJ22CU/jYxC5fGvWYOBd/xubdgHxHJHQPqSvchd8LD+w8Zdhl/6ZvA3wtYGOJ3ZC8sGd4c0uIAnI/FnjaZz6Af4khkJG5RG/Xfjaps1poZhCuThLxe4loqY3sgrUWqIurPh5ZydAvN7MRTiItxH6W7Ce0DDFOdI+qCc9/1luHAo+MgO1g0pwN+cJ5J2xmXxSbN8SLp0wNJ+9 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: On Thu 07-09-23 12:33:47, Jeff Layton wrote: > With the advent of multigrain timestamps, we use inode_set_ctime_current > to set the ctime, which can skip updating if the existing ctime appears > to be in the future. Because we don't initialize this field at > allocation time, that could prevent the ctime from being initialized > properly when the inode is instantiated. > > Always initialize the ctime field to the epoch so that the filesystem > can set the timestamps properly later. > > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-lkp/202309071017.a64aca5e-oliver.sang@intel.com > Signed-off-by: Jeff Layton Looks good but don't you need the same treatment to atime after your patch 2/2? Honza > --- > fs/inode.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/inode.c b/fs/inode.c > index 35fd688168c5..54237f4242ff 100644 > --- a/fs/inode.c > +++ b/fs/inode.c > @@ -168,6 +168,8 @@ int inode_init_always(struct super_block *sb, struct inode *inode) > inode->i_fop = &no_open_fops; > inode->i_ino = 0; > inode->__i_nlink = 1; > + inode->__i_ctime.tv_sec = 0; > + inode->__i_ctime.tv_nsec = 0; > inode->i_opflags = 0; > if (sb->s_xattr) > inode->i_opflags |= IOP_XATTR; > > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR