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 7AE0DC07E8A for ; Wed, 9 Aug 2023 16:31:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D5FC26B0071; Wed, 9 Aug 2023 12:31:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CE98F6B0074; Wed, 9 Aug 2023 12:31:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B8A6E8E0001; Wed, 9 Aug 2023 12:31:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A91476B0071 for ; Wed, 9 Aug 2023 12:31:05 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 549FE140ECC for ; Wed, 9 Aug 2023 16:31:05 +0000 (UTC) X-FDA: 81105105690.21.3E9C4C7 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf16.hostedemail.com (Postfix) with ESMTP id 41F70180006 for ; Wed, 9 Aug 2023 16:31:01 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UPQGy8NQ; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf16.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691598662; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=y5zTR+vxWGRlvMSQR3R9jU//2eDeiTSiMZYjt/BtdFU=; b=tUIildDBssgrqm0fB/mhPVrQ6rEBBrTCBdG5/OhdsuN+P6PJgyhCPhbj/I1gHB0SXl++MF W+GYHBk06Zno6U20HwXOlV5yhiKVFKjEqX8grdkceOqBQM3q1teSqrs/6geIwnIRjXe7WY ZO5ntW00M2zpOZvgw1j5hr31lm3kLJs= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UPQGy8NQ; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf16.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691598662; a=rsa-sha256; cv=none; b=dggwPnu4w7rnGTBY2XAIIh9AgkHNHYp3N3BcCsMBKjnbVlOQy7R6zfBYRlCQ1LPXfoW9Qp thPc+iRDoQ3/a/VskWo7pkm7HD3pO68KgnBejtdqSHxJwmHrYvhOyjQZTOBkY6CoL8ylss D5jcbLWPGaIQ4JjfG0ghq/ES+TwyIwY= 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 2611963262; Wed, 9 Aug 2023 16:31:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00FEDC433C8; Wed, 9 Aug 2023 16:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691598660; bh=Z7n9zJLdl712XVn1Py2iFtPG8LzL7lbCWNuqyD+/A3g=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=UPQGy8NQtXAAQ4aU3XYZHYnotv5CJersRvEj3UxLTDTNa1yXwNRn0IJiEHo/bl0VP UZsTGWxiaK4MtB7dfslKXsWsCHmiZVr63spdJLnJq8JDgcyekVH5Xc7NL7sGLhreu6 x15cmd+UhtlNWpehU4jYdveXB5k/7G4WPmTr0CQ6bDhyChBFc9/xsm+0Rn2qIx7rJs G7MVuLgnF5bvQR49Ipq6cF6+TvuMnXYBCNHAg7UV972mLj2aJnJNB5RVRDI4hEyHex /4cPUAWVkqpnS01ZlGmCOld61C8SWimdxp5ttui+xDqTyf2eAGc7ZrzDWG2FklGBAx JNZznme+soZDw== Message-ID: <2cb998ff14ace352a9dd553e82cfa0aa92ec09ce.camel@kernel.org> Subject: Re: [PATCH v7 05/13] fat: make fat_update_time get its own timestamp From: Jeff Layton To: OGAWA Hirofumi , Jan Kara Cc: Alexander Viro , Christian Brauner , 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 , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , Greg Kroah-Hartman , Tejun Heo , 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 , Amir Goldstein , "Darrick J. Wong" , Benjamin Coddington , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@telemann.coda.cs.cmu.edu, ecryptfs@vger.kernel.org, linux-erofs@lists.ozlabs.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-unionfs@vger.kernel.org, linux-xfs@vger.kernel.org Date: Wed, 09 Aug 2023 12:30:52 -0400 In-Reply-To: <87v8do6y8q.fsf@mail.parknet.co.jp> References: <20230807-mgctime-v7-0-d1dec143a704@kernel.org> <20230807-mgctime-v7-5-d1dec143a704@kernel.org> <87msz08vc7.fsf@mail.parknet.co.jp> <52bead1d6a33fec89944b96e2ec20d1ea8747a9a.camel@kernel.org> <878rak8hia.fsf@mail.parknet.co.jp> <20230809150041.452w7gucjmvjnvbg@quack3> <87v8do6y8q.fsf@mail.parknet.co.jp> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Rspamd-Queue-Id: 41F70180006 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: sj1dpr73yfrcftkrksf3mdpgxq5ymtst X-HE-Tag: 1691598661-396757 X-HE-Meta: U2FsdGVkX1+zo2nLyAdDfZ09KpOXetrP0zrrpr76Vjd7WcYe6HR2QJqdz9YHz3CqrhqWZLp7DYzmrbWuebzTk1au7pTxbMX9yBCdeNFemkdc0PIepHBSbu4dhEMJj6+NMSnb/RA723iyZF0U7uoeKu3KeSYeTzne8jAgnhEKi8p5rA4tbER3hoz2d9PhmXvBQbvgQKzKY3unR5QjFvs5L2UP+hLh20FWdGR45/uiVZ8cehQEwLvJXXtBvrJYBoSBAnZqOfprSTF9oYV4tpfPwYbIz7UUi3NXuFToJxqwZcUQW80ZUdde4fueU6mG6hN1wLRn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= 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, 2023-08-10 at 00:17 +0900, OGAWA Hirofumi wrote: > Jan Kara writes: >=20 > > Since you are talking past one another with Jeff let me chime in here := ). I > > think you are worried about this hunk: >=20 > Right. > > > - if ((flags & S_VERSION) && inode_maybe_inc_iversion(inode, false)) > > + if ((flags & (S_VERSION|S_CTIME|S_MTIME)) && inode_maybe_inc_iversion= (inode, false)) > > dirty_flags |=3D I_DIRTY_SYNC; > >=20 > > which makes the 'flags' test pass even if we just modified ctime or mti= me. > > But do note the second part of the if - inode_maybe_inc_iversion() - so= we > > are going to mark the inode dirty with I_DIRTY_SYNC only if someone que= ried > > iversion since the last time we have incremented it. > >=20 > > So this hunk is not really changing how inode is marked dirty, it only > > changes how often we check whether iversion needs increment and that sh= ould > > be fine (and desirable). Hence lazytime isn't really broken by this in = any > > way. >=20 > OK. However, then it doesn't explain what I asked. This is not same with > generic_update_time(), only FAT does. > > If thinks it is right thing, why generic_update_time() doesn't? I said > first reply, this was from generic_update_time(). (Or I'm misreading > updated generic_update_time()?) >=20 My mistake re: lazytime vs. relatime, but Jan is correct that this shouldn't break anything there. The logic in the revised generic_update_time is different because FAT is is a bit strange. fat_update_time does extra truncation on the timestamp that it is handed beyond what timestamp_truncate() does. fat_truncate_time is called in many different places too, so I don't feel comfortable making big changes to how that works. In the case of generic_update_time, it calls inode_update_timestamps which returns a mask that shows which timestamps got updated. It then marks the dirty_flags appropriately for what was actually changed. generic_update_time is used across many filesystems so we need to ensure that it's OK to use even when multigrain timestamps are enabled. Those haven't been enabled in FAT though, so I didn't bother, and left it to dirtying the inode in the same way it was before, even though it now fetches its own timestamps from the clock. Given the way that the mtime and ctime are smooshed together in FAT, that seemed reasonable. Is there a particular case or flag combination you're concerned about here? --=20 Jeff Layton