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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBDC8EB64DC for ; Wed, 19 Jul 2023 01:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ozlabs.org; s=201707; t=1689730554; bh=xZssYNKocP7SJAjxckC3wBJ507CzulE9IvrMWjf3P+k=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=eXUSx++ba2SmaS4BXYtfi+7je50zcR9vp8LhHjaZReDAjZs1ZupxSvYIp9Uf6nofP yWsKp/+xl8cVeo7RkHdIWcmEqTtYWwk3Kj1X+Cb1fba6innur6iMhBo7IgcUiYegxo 3ZSjrwNFRAW5fksgtLQi6D0l5g4b9jWnvB7toOi2hahQ8D13Soy4xjeFLI7XUBGXes RN0DJ78Q/cHGkDFNRiLvmiNTypYVD52M+0eUDTdWaBJ22CVQOCqX4zWdcmKvsySS/v dOdZFzwrKUXgqEIUrw/HfjdtNc12IbFkruZ1vkaMPMxkhi7ATZJgFZp2xtq4U9g06a zPGTmGVa7J92w== Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4R5JLL0MPSz3bZ4 for ; Wed, 19 Jul 2023 11:35:54 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=fromorbit-com.20221208.gappssmtp.com header.i=@fromorbit-com.20221208.gappssmtp.com header.a=rsa-sha256 header.s=20221208 header.b=UyEHrifu; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=fromorbit.com (client-ip=2001:4860:4864:20::31; helo=mail-oa1-x31.google.com; envelope-from=david@fromorbit.com; receiver=lists.ozlabs.org) Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4R5JLB1mPHz2ykT for ; Wed, 19 Jul 2023 11:35:44 +1000 (AEST) Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-1bac0e25891so754525fac.2 for ; Tue, 18 Jul 2023 18:35:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689730542; x=1692322542; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xZssYNKocP7SJAjxckC3wBJ507CzulE9IvrMWjf3P+k=; b=Vb7NYZnf2Q5Mo3JKrURnhLP8vKPDk5k24Yi09v9xFl40UMg4ppnz/jJ4MHIPJH+PXj h4HfA8ultad98Y+u9oNE8LHRpJeIYAJHojTClJPnT+H1fw6Ow1b2q1ES0VPneHr/GF+X RySvc2mpp4tJ8qKgMth4/otEJ947vimYiEFAt498b4G56kVMfOXaFWdOxr+1+DxuQbhn Nj4ibhXs8wsWa6n5Q9kjInprDXSP+x1jMVMKAlg+9h72Lw/2DqYEnf+vOGXlEMtcB+cJ DjGCfKyIRZUEv5hgCBi6x7gKyBHQjc3hJ+7i8tVq2uELSabm7dMQzXleLAQVTl0jwbUv ViZQ== X-Gm-Message-State: ABy/qLbhK/cCRNAUOKgpHK5N6HtsFzqStDzmgy7dTn1HtwyNBO2E/Xhv 3jPuxipNf1whV9clQmzS2WpHpg== X-Google-Smtp-Source: APBJJlHb4gEwJfD+TL2icCrXL1rPSO1/If2sqk52+FC1gSV2ztjdma15fYoDbEqUpP5c7bsoFPcHEw== X-Received: by 2002:a05:6870:96a6:b0:1b3:8d35:c85f with SMTP id o38-20020a05687096a600b001b38d35c85fmr1011777oaq.1.1689730541592; Tue, 18 Jul 2023 18:35:41 -0700 (PDT) Received: from dread.disaster.area (pa49-186-119-116.pa.vic.optusnet.com.au. [49.186.119.116]) by smtp.gmail.com with ESMTPSA id 201-20020a6301d2000000b005633311c70dsm2343100pgb.32.2023.07.18.18.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 18:35:40 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1qLw6L-007mcz-1V; Wed, 19 Jul 2023 11:35:37 +1000 Date: Wed, 19 Jul 2023 11:35:37 +1000 To: Jeff Layton Subject: Re: [PATCH v5 6/8] xfs: switch to multigrain timestamps Message-ID: References: <20230713-mgctime-v5-0-9eb795d2ae37@kernel.org> <20230713-mgctime-v5-6-9eb795d2ae37@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230713-mgctime-v5-6-9eb795d2ae37@kernel.org> X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dave Chinner via Linux-erofs Reply-To: Dave Chinner Cc: Latchesar Ionkov , Martin Brandenburg , Konstantin Komarov , linux-xfs@vger.kernel.org, "Darrick J. Wong" , Dominique Martinet , Christian Schoenebeck , David Howells , Chris Mason , Andreas Dilger , Hans de Goede , Marc Dionne , codalist@coda.cs.cmu.edu, linux-afs@lists.infradead.org, Mike Marshall , Paulo Alcantara , linux-cifs@vger.kernel.org, Eric Van Hensbergen , Andreas Gruenbacher , Miklos Szeredi , Richard Weinberger , Mark Fasheh , Hugh Dickins , Tyler Hicks , cluster-devel@redhat.com, coda@cs.cmu.edu, linux-mm@kvack.org, linux-f2fs-devel@lists.sourceforge. net, Ilya Dryomov , Iurii Zaikin , Namjae Jeon , Trond Myklebust , Shyam Prasad N , ecryptfs@vger.kernel.org, Kees Cook , ocfs2-devel@lists.linux.dev, Josef Bacik , Tom Talpey , Tejun Heo , Yue Hu , Alexander Viro , linux-mtd@lists.infradead.org, David Sterba , Jaegeuk Kim , ceph-devel@vger.kernel.org, Xiubo Li , OGAWA Hirofumi , Jan Harkes , Christian Brauner , linux-ext4@vger.kernel.org, Theodore Ts'o , Joseph Qi , Greg Kroah-Hartman , v9fs@lists.linux.dev, ntfs3@lists.linux.dev, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, Ronnie S ahlberg , Steve French , Sergey Senozhatsky , Luis Chamberlain , devel@lists.orangefs.org, Anna Schumaker , Jan Kara , Bob Peterson , linux-fsdevel@vger.kernel.org, Andrew Morton , Sungjong Seo , linux-erofs@lists.ozlabs.org, linux-nfs@vger.kernel.org, linux-btrfs@vger.kernel.org, Joel Becker Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Thu, Jul 13, 2023 at 07:00:55PM -0400, Jeff Layton wrote: > Enable multigrain timestamps, which should ensure that there is an > apparent change to the timestamp whenever it has been written after > being actively observed via getattr. > > Also, anytime the mtime changes, the ctime must also change, and those > are now the only two options for xfs_trans_ichgtime. Have that function > unconditionally bump the ctime, and warn if XFS_ICHGTIME_CHG is ever not > set. > > Signed-off-by: Jeff Layton > --- > fs/xfs/libxfs/xfs_trans_inode.c | 6 +++--- > fs/xfs/xfs_iops.c | 4 ++-- > fs/xfs/xfs_super.c | 2 +- > 3 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c > index 0c9df8df6d4a..86f5ffce2d89 100644 > --- a/fs/xfs/libxfs/xfs_trans_inode.c > +++ b/fs/xfs/libxfs/xfs_trans_inode.c > @@ -62,12 +62,12 @@ xfs_trans_ichgtime( > ASSERT(tp); > ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); > > - tv = current_time(inode); > + /* If the mtime changes, then ctime must also change */ > + WARN_ON_ONCE(!(flags & XFS_ICHGTIME_CHG)); Make that an ASSERT(flags & XFS_ICHGTIME_CHG), please. There's no need to verify this at runtime on production kernels. -Dave. -- Dave Chinner david@fromorbit.com