Received: by 2002:ac8:734e:0:b0:40f:fb00:664b with SMTP id q14csp1716185qtp; Wed, 9 Aug 2023 09:46:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUUYJczf4FTq67aoD6QcpOYe46Ad8j9blyylO6ewf5B3Y2h6D0Wuw7/cO+Jp6JjRis2jXK X-Received: by 2002:a17:907:7788:b0:997:865a:77e3 with SMTP id ky8-20020a170907778800b00997865a77e3mr2488224ejc.11.1691599597396; Wed, 09 Aug 2023 09:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691599597; cv=none; d=google.com; s=arc-20160816; b=YuK/rgBA4MORjUT7W0qD0oir0bPb5HT92Jcw/pdIkBcKJkHh2FnUoMhsvsvQzu9s2c eLcaHWGGTdAJvy817VSeevSRsZJFKEsLqRA+np2uDCrhW+fMOIl+VWI6K6J4ouP86vjp HhzbayVMULzBU8ss3Fr3FRNFVbNzvqyfgTfi778mIZAaK7nuMnY+H7Eb+AWo2z9qYI6F qTEf5Eaf8MctKoGa/emxrw/f746R51CVmWcirLKVeubhiwiFiXUzUbCNim0uDzib2ncO Ll61MAfIm8xIgefVtjhP148Vg4xW5fhCYWCfHT4OoAcH2XLrQj+IY6kHJqM84kwssIX/ /VDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=y5zTR+vxWGRlvMSQR3R9jU//2eDeiTSiMZYjt/BtdFU=; fh=dd61sISDCKACaCxK83XaUzViuvKFWQGIbiyo3/tT3y4=; b=zrCakvxKJ/J9vO/gDFJQNFyrOLfrLmsn+Yds+z2eXQBXiWneIcR11XX6F8qqwK5FGK ob/acNQvGwv9LDF04TV7ocSv8zoX7ptHYL8CwkupiC3kgDcD4AgaG3QJxo7cnglOUXr6 MTs4sCTXslgV7VFtLPitm2efk7H8uvkkgMYhX/Q0YiPgKOBVYF9wqE6Iyn07Bb2dpZ+m iLgeaJTflrv7NXK7yuSuyNYof/GD7aPNB6Q/EffiM/URKNLjpNGTEDMoMl5qDWcKGiGj TjOLUk7p+jikF4ci/oG9rOQoXFVaBO3vTV0X+9jR/f7Z6U8D8OdICpG/rahX/Mnloetk GeWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UPQGy8NQ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-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 d19-20020a1709067f1300b0099334262e18si9801481ejr.49.2023.08.09.09.46.11; Wed, 09 Aug 2023 09:46:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=UPQGy8NQ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-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 S230382AbjHIQbD (ORCPT + 99 others); Wed, 9 Aug 2023 12:31:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbjHIQbC (ORCPT ); Wed, 9 Aug 2023 12:31:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A6C210F3; Wed, 9 Aug 2023 09:31:01 -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 2950F63697; 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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-nfs@vger.kernel.org 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