Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp82250rwl; Wed, 9 Aug 2023 11:14:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyo/IjgTF8EwmF42p+HQ6DOI85UngGTps/gxzynSJxx/uGhmFESSi/nZYN93uRlr1CWxzU X-Received: by 2002:a17:907:2cf4:b0:99b:e5c3:2e45 with SMTP id hz20-20020a1709072cf400b0099be5c32e45mr2603740ejc.28.1691604847091; Wed, 09 Aug 2023 11:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691604847; cv=none; d=google.com; s=arc-20160816; b=uo65amx0E/7YqjXrzqKa8NtnITVXXYvIe4UCbJZuqDpJ3gh/3mGjh9eelY0in5/nm7 3GwTQBjcHUENk+JaWwtCeqxL6Em4hWb44GrbhgH92o8pKEuoztTZWofuLV1gIC3YxVr9 +WOErRAhmXbNqbqgzEdyI/JWF0Em/tsYemzZfojkrsiAZ3jLOoWmVeJNVDcFVzHlen6V CH42CVb4MV0Q42nwz0YYvB8cwpASmJ78ZxIPsaUd646tkvwSVtPy1qchZC4T9lumSNXn O/0cpxMcHAuKEYAzZwucAiUyF1HEGlF7bnF8Kwjyv2v0FK/AL/5iFO0vBUu7krU+xfrL eNEA== 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:message-id:date :references:in-reply-to:subject:cc:to:from; bh=9jkYqqrSdW2TNClBkYoVNPjtQleOVpeTi7MhHUhEFB4=; fh=bJlJjuOzgKNakDA51gnvjMNidwP7gcimZv75hI7f4rM=; b=Wged2VSSAUkIPFqw5TW7WAO5hqDQpCOEawugTiVmgrasyiF0mkJSe1orcNKyc3yXZ6 OOB4jQiqdCBBrckUNOhSr93ZE0SMpT4NIKfo9b3UfCsysI3qGz2FJwSdRmPG2UV2Lcg+ aTMoPE7ICtvOLtKW9PEqlmasMlkqrQTZ5uiTF96tVNHUX/vvOC+o3t4Ob5O56QLkczng 6EO9lXQJiCCg6hb+JXHKFiNIsU3mGr4irI/2OFwLPdA/b2+2Uu6wcKnZmf6+6Us6meyf tEVYCMl52fcvNkX637lrWvIWe4yhZ7wX173jcFugeCuGMpiDYV4gzlEsnHGWA02ZW1VW ijNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lf9-20020a170906ae4900b00991fcf4687dsi8533518ejb.186.2023.08.09.11.13.34; Wed, 09 Aug 2023 11:14:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232808AbjHIRoW (ORCPT + 99 others); Wed, 9 Aug 2023 13:44:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjHIRoV (ORCPT ); Wed, 9 Aug 2023 13:44:21 -0400 Received: from mail.parknet.co.jp (mail.parknet.co.jp [210.171.160.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9377810D2; Wed, 9 Aug 2023 10:44:19 -0700 (PDT) Received: from ibmpc.myhome.or.jp (server.parknet.ne.jp [210.171.168.39]) by mail.parknet.co.jp (Postfix) with ESMTPSA id B41832055FA5; Thu, 10 Aug 2023 02:44:18 +0900 (JST) Received: from devron.myhome.or.jp (foobar@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.17.2/8.17.2/Debian-1) with ESMTPS id 379HiHKW223321 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 10 Aug 2023 02:44:18 +0900 Received: from devron.myhome.or.jp (foobar@localhost [127.0.0.1]) by devron.myhome.or.jp (8.17.2/8.17.2/Debian-1) with ESMTPS id 379HiHXo222009 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 10 Aug 2023 02:44:17 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.17.2/8.17.2/Submit) id 379HiApg221995; Thu, 10 Aug 2023 02:44:10 +0900 From: OGAWA Hirofumi To: Jeff Layton Cc: Jan Kara , 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 Subject: Re: [PATCH v7 05/13] fat: make fat_update_time get its own timestamp In-Reply-To: <2cb998ff14ace352a9dd553e82cfa0aa92ec09ce.camel@kernel.org> (Jeff Layton's message of "Wed, 09 Aug 2023 12:30:52 -0400") 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> <2cb998ff14ace352a9dd553e82cfa0aa92ec09ce.camel@kernel.org> Date: Thu, 10 Aug 2023 02:44:10 +0900 Message-ID: <87leek6rh1.fsf@mail.parknet.co.jp> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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-ext4@vger.kernel.org Jeff Layton writes: > On Thu, 2023-08-10 at 00:17 +0900, OGAWA Hirofumi wrote: >> Jan Kara writes: [...] > My mistake re: lazytime vs. relatime, but Jan is correct that this > shouldn't break anything there. Actually breaks ("break" means not corrupt fs, means it breaks lazytime optimization). It is just not always, but it should be always for some userspaces. > 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? Yes. Because FAT has strange timestamps that different granularity on disk . This is why generic time truncation doesn't work for FAT. Well anyway, my concern is the only following part. In generic_update_time(), S_[CM]TIME are not the cause of I_DIRTY_SYNC if lazytime mode. - 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 |= I_DIRTY_SYNC; If reverted this part to check only S_VERSION, I'm fine. Thanks. -- OGAWA Hirofumi