Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4735683rwb; Tue, 8 Aug 2023 13:01:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+RtNBRhvOcABDYx9OH9IaM+zhUBVwwjK0mZx82GQrJebNFBpl4g+Ygkd3zjvs407eg+vV X-Received: by 2002:a9d:6b02:0:b0:6bc:be56:6b9b with SMTP id g2-20020a9d6b02000000b006bcbe566b9bmr681763otp.2.1691524897347; Tue, 08 Aug 2023 13:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691524897; cv=none; d=google.com; s=arc-20160816; b=r1g8in7kWXXHpcbB2LwlwLKuW+ldX4eX9377ysT8Jiknq8nLBsEdQ721PQP2pcXG4Z rMpm1K4oXf4crvYv4vE4SaWNcTq6+P6BRaLgQmXPSeXDq9vAtoOhZ8lXOhCFzYY+z1HH BsgRH12L32fp3T9NTAg1aS30USca7KvTA1HZPFS75dlWY19rPYUrcjzm0GC5ZGLSEGE6 H6TCNIeUuojPbe7b0cFqS/TTYm2jQUy1DELFzYcA3i2QzefAJpIiWhQyX3HJbKZrWaeM JkRIGJ0tYLpOYphN2GQLAOvdMxO0CfI6J37emrfg7XW2TmL7DC2/26IS2ju42Fz0qcWr eEnA== 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=+dwojIKMsZIfKNojdAYP/LpuQmw+6rqqzdeGXh9OKdQ=; fh=VDS1Ji1Jg94b8HYa+h+b069MTX7Y1JPYBeWAMaZH+VI=; b=0btgcFWd2aXHJG+27XMlw9UkWLs1djaZBP0SdTyHTwNIeWkkUtD/O898gOmZdbMUuH 2JHRQzlMJNVUHofHCAY8fOTcl48HJdvdY13H842+lEZ+x5R+hn95ocf84avf0oTnn2+c VPJMKp0iIIeucpjQTwMLdnMpIWngIiNFbraC+t17n1AohwCFOVJELvM1A9n/4pLZKEsw 7vFXOVJX2g9il7HWSFEJKPItx+ITlPfv+gP4NcH/Ek11bhcF0w4GjFMP7h14cQ02uCuM KmnePqZYB9VyMOdRlqsGQDgigQTLcB+t3AWAy5bZRhhdLgb1N/LbmHyHQGm6Y5+Q7GAO S9NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=xNkmZedH; dkim=neutral (no key) header.i=@suse.cz header.b=C9mvCUPa; 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 z24-20020a63c058000000b00563fbbe378dsi7581076pgi.347.2023.08.08.13.01.24; Tue, 08 Aug 2023 13:01: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=@suse.cz header.s=susede2_rsa header.b=xNkmZedH; dkim=neutral (no key) header.i=@suse.cz header.b=C9mvCUPa; 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 S236136AbjHHTVB (ORCPT + 99 others); Tue, 8 Aug 2023 15:21:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236027AbjHHTUl (ORCPT ); Tue, 8 Aug 2023 15:20:41 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F210510817A; Tue, 8 Aug 2023 09:44:02 -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 32CD41F381; Tue, 8 Aug 2023 09:37:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1691487422; 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=+dwojIKMsZIfKNojdAYP/LpuQmw+6rqqzdeGXh9OKdQ=; b=xNkmZedHCH4JfPl5aI/7jFcoHvCmU2Ei7iO7owXcuJIhPHMXaR9JIDbudRkrv+OpRvBT78 QcY9S7zG3KilNTQJsdlbMzoPhbFYNRjSDo58qiEL/KKnRHAz06+KLjpoPEh0KdB8jKpl0d Paghc7ScJ479EYrBJsHB5zKlYU4EE1o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1691487422; 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=+dwojIKMsZIfKNojdAYP/LpuQmw+6rqqzdeGXh9OKdQ=; b=C9mvCUPaAa2cOnSGsmSgpsXVt5ts05YWI0vruOwxYGEk08U30pxAruMbAfjG0JtSrXhSu+ h+OsL5aeMUqW5DAg== 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 1E00A13451; Tue, 8 Aug 2023 09:37:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id JlhMB74M0mRkHQAAMHmgww (envelope-from ); Tue, 08 Aug 2023 09:37:02 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 9F88DA0769; Tue, 8 Aug 2023 11:37:01 +0200 (CEST) Date: Tue, 8 Aug 2023 11:37:01 +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 06/13] ubifs: have ubifs_update_time use inode_update_timestamps Message-ID: <20230808093701.ggyj7tyqonivl7tb@quack3> References: <20230807-mgctime-v7-0-d1dec143a704@kernel.org> <20230807-mgctime-v7-6-d1dec143a704@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230807-mgctime-v7-6-d1dec143a704@kernel.org> X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL,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:37, Jeff Layton wrote: > In later patches, we're going to drop the "now" parameter from the > update_time operation. Prepare ubifs for this, by having it use the new > inode_update_timestamps helper. > > Signed-off-by: Jeff Layton One comment below: > diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c > index df9086b19cd0..2d0178922e19 100644 > --- a/fs/ubifs/file.c > +++ b/fs/ubifs/file.c > @@ -1397,15 +1397,9 @@ int ubifs_update_time(struct inode *inode, struct timespec64 *time, > return err; > > mutex_lock(&ui->ui_mutex); > - if (flags & S_ATIME) > - inode->i_atime = *time; > - if (flags & S_CTIME) > - inode_set_ctime_to_ts(inode, *time); > - if (flags & S_MTIME) > - inode->i_mtime = *time; > - > - release = ui->dirty; > + inode_update_timestamps(inode, flags); > __mark_inode_dirty(inode, I_DIRTY_SYNC); > + release = ui->dirty; > mutex_unlock(&ui->ui_mutex); I think this is wrong. You need to keep sampling ui->dirty before calling __mark_inode_dirty(). Otherwise you could release budget for inode update you really need... > if (release) > ubifs_release_budget(c, &req); Honza -- Jan Kara SUSE Labs, CR