Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4902524rwb; Tue, 8 Aug 2023 16:17:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKujmfqSjLEbmMFi7+1PXEjaUutwpsZQRdO+dwWMcUp/I+WRfPau837eggEojBy6Jt/Czs X-Received: by 2002:a17:906:74c4:b0:991:dc98:69ff with SMTP id z4-20020a17090674c400b00991dc9869ffmr798506ejl.67.1691536647479; Tue, 08 Aug 2023 16:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691536647; cv=none; d=google.com; s=arc-20160816; b=gwFccoXP4sm3meFXTBXOOwtCzF7einEgdpIZ93KO/jAsCuWKGq6hKjCOZtPHytiTId b0r1UCBA8HJxVfOJHzMbwK6Zw9NsALFVemuntyi5VDe2V6E/GRFxRT59IdEiWOXjb81U OA8wyKnxtICe2EzNcjDKiU8aSV/VWD8xLyAqgUcSF8hXGgZGJAaaFJ9ab8brHKdETbCh hoscik7awMM798vQq7LRw7/g3YeeSn5brZAiJekC+Hy03ntWzGhvCMarV+yR6mXAzuNB ymk4tewJ6/h3qiKMmancad9SWi7xChvxtFl98OmnP/Nv2/Mio0L1ohsgmixcbIfEfyz8 PD1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=URemeKpdb8J18iMONbqIB4P02haKyRX6mS8Xu4Mgmc8=; fh=VDS1Ji1Jg94b8HYa+h+b069MTX7Y1JPYBeWAMaZH+VI=; b=qXavhExcABokLvR2poXevi694/C0Keo8rQvGE1poGtIPxQ49oK8xoPsvYsh9kDYPDe yA2sX+IUSe96oJ208TzK8RrZeMSzSnPDPr3KHP19TVFtCBi5Cxef4x0d66w7WU83dc9o kzLCz63LDG5PSna5qSJZOiBQcVlzqzfL/8vAgyuq90ySVxB253uebRF48fhqI+SS09CX pN+8aT027uvN8MxDa9BHhIckUxw3lHVDcW7oKowdTTpGVlMBV6TplcnewjtN27laI4Tq 1buRkxlRgF6T7YZXptUBBg9oAy1LKfyuuAK5I00StnWrEP5wjRXDCBRZZNK22n/GYWLA DP+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="kAP4/qU3"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kl12-20020a170907994c00b00993a68a3af6si5348015ejc.511.2023.08.08.16.17.03; Tue, 08 Aug 2023 16:17:27 -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=@suse.cz header.s=susede2_rsa header.b="kAP4/qU3"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231633AbjHHV6R (ORCPT + 99 others); Tue, 8 Aug 2023 17:58:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbjHHV6G (ORCPT ); Tue, 8 Aug 2023 17:58:06 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4E593A68F; Tue, 8 Aug 2023 09:39:25 -0700 (PDT) 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 313B020317; Tue, 8 Aug 2023 09:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1691487147; 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=URemeKpdb8J18iMONbqIB4P02haKyRX6mS8Xu4Mgmc8=; b=kAP4/qU3eebbLi9EbGgoNiblqEAMz2n9d8dDZjEU/zYHxmh4xQUAW4aRmDsDFAo1LDW4XS Jz3jziQyqFQJ2OS6XJQCmcd5h9qdcD3Byn8qpddgol9CAV8ew1WhVYDKOVKgTmZrEM14u3 +VucJ+n1ddguqczAaW5Ki56KFXcMMvI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1691487147; 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=URemeKpdb8J18iMONbqIB4P02haKyRX6mS8Xu4Mgmc8=; b=zakAo2cWrWyYBcipF4rIUwLGrOqm5ZeFyaCmUH+fTkQWLNKyEQyre7V0L+jFNWPtWdDjYF EO0z/Yllpo+E3ODA== 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 1EA0313451; Tue, 8 Aug 2023 09:32:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uyF3B6sL0mR7GwAAMHmgww (envelope-from ); Tue, 08 Aug 2023 09:32:27 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 82443A0769; Tue, 8 Aug 2023 11:32:26 +0200 (CEST) Date: Tue, 8 Aug 2023 11:32:26 +0200 From: Jan Kara To: Jeff Layton 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 , OGAWA Hirofumi , 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@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 Message-ID: <20230808093226.bq2qfxv5npckk643@quack3> References: <20230807-mgctime-v7-0-d1dec143a704@kernel.org> <20230807-mgctime-v7-5-d1dec143a704@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230807-mgctime-v7-5-d1dec143a704@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 Mon 07-08-23 15:38:36, Jeff Layton wrote: > In later patches, we're going to drop the "now" parameter from the > update_time operation. Fix fat_update_time to fetch its own timestamp. > It turns out that this is easily done by just passing a NULL timestamp > pointer to fat_update_time. ^^^ fat_truncate_time() > Also, it may be that things have changed by the time we get to calling > fat_update_time after checking inode_needs_update_time. Ensure that we > attempt the i_version bump if any of the S_* flags besides S_ATIME are > set. > > Signed-off-by: Jeff Layton Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/fat/misc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/fat/misc.c b/fs/fat/misc.c > index 67006ea08db6..8cab87145d63 100644 > --- a/fs/fat/misc.c > +++ b/fs/fat/misc.c > @@ -347,14 +347,14 @@ int fat_update_time(struct inode *inode, struct timespec64 *now, int flags) > return 0; > > if (flags & (S_ATIME | S_CTIME | S_MTIME)) { > - fat_truncate_time(inode, now, flags); > + fat_truncate_time(inode, NULL, flags); > if (inode->i_sb->s_flags & SB_LAZYTIME) > dirty_flags |= I_DIRTY_TIME; > else > dirty_flags |= I_DIRTY_SYNC; > } > > - 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; > > __mark_inode_dirty(inode, dirty_flags); > > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR