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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C419BC41513 for ; Wed, 9 Aug 2023 07:07:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231190AbjHIHHE (ORCPT ); Wed, 9 Aug 2023 03:07:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbjHIHGx (ORCPT ); Wed, 9 Aug 2023 03:06:53 -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 14DF11FF6; Wed, 9 Aug 2023 00:06:53 -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 9FAEA62FC9; Wed, 9 Aug 2023 07:06:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46BD8C433C7; Wed, 9 Aug 2023 07:06:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691564812; bh=LyptcIlHZJMPRLgCQdT8M5vqzNKCvVA2tglx+SSzKhk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bD7f0dTITrbaEv4ks9HGhx0VVGQl2go0/eu1op4nP82j4N7TgX5btWqWiaSGoe8jp i6+z7Q/Jk2DuDRVzKbPo4bN2rJnb7ZSAdXE4Z0xYd+h6nr/dULJQsuanMXc8U/mPWC durewToMDZYiugVbqFDpM/vlNxIknI7IjiKj4iWyBj6wWmzWhg0/t+ygbJ1TK6LZ+2 DAg/4gaYUGbCnyrWc2K3wnSswvzR8b++oY6In8hF21Owe2spxR27o2A1Ew8ijOuuN3 Wo+4rLZHSLxhk9EzIXmcSquBg+Bnp2nKOE70h2bjG7fT6iPfQRAHqxOjlzas9G4WAl a1bfUfvPCKxNg== Date: Wed, 9 Aug 2023 09:06:34 +0200 From: Christian Brauner To: Jan Kara Cc: Jeff Layton , Alexander Viro , 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: <20230809-handreichung-umgearbeitet-951eebed4d61@brauner> References: <20230807-mgctime-v7-0-d1dec143a704@kernel.org> <20230807-mgctime-v7-6-d1dec143a704@kernel.org> <20230808093701.ggyj7tyqonivl7tb@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230808093701.ggyj7tyqonivl7tb@quack3> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Aug 08, 2023 at 11:37:01AM +0200, Jan Kara wrote: > 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... Fixed in-tree.