Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1775109rwn; Fri, 16 Sep 2022 00:00:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5lxHJakGg03w6leT19/ua43LBKTtJWkgHyzQhGo4tmEheJRlPtk8X9RpMCzL+Eqmn4jNnm X-Received: by 2002:a17:90b:4f84:b0:202:dd39:c03d with SMTP id qe4-20020a17090b4f8400b00202dd39c03dmr14505319pjb.63.1663311646218; Fri, 16 Sep 2022 00:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663311646; cv=none; d=google.com; s=arc-20160816; b=do3jffutLQiu1V02IRpKiivUtYGdwTZiJhc65usvtvKehIJnVSGWPSGhRcSY+g7q7x OnBvaV0lpKiQiMSSYeTqzHtC5zicZp5YrMVyBo66eDoaCth9YxyzkyDsUZTeSlLTBIJo OCGfw+/2ziYLosKsnHts+o9yu8yz4Kj1gxuUJdFkwc3kFuxEGl7VERplpQnPZ0eB/OBX l3d4+kyiInDn5F4dhJrIBjNlJBsOT7AE6ijdeLhGiObbCwZdwcOnTu5XOM5t236f4vk3 Vo+eIPgLjzCKTPOOgTpFVS40Gf59cHEPhxoxX9NDkOr8qBgajo61RQpEC74bZlYGRYDh u94Q== 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; bh=jqjwwvRnowqEU63Vd3ESTJA7Bt/dd4WUfiC93PuK8ls=; b=KFk4L4iiT+MDT3M2rJbiJqWhLcIXq1jWHdtNFn+A3jAjUlaJ2T9nyR1hYW5rsu/HdI 80t/aOqRWjBUkPR0rILHgaMvTHQOE8nE7wuBIsEnaMuy/Yl4BEoLaGkf8j7xUJcwUehu kKB6lg+Rc2M5+CL5utHfNO9nF+ja8AlahF8G4OXhXWYaNESbRMApOr9iSqTvYkhqrEad bHF3qwqlseEzR+wdKA+M++CSLsT+MvmYqsSSnlY1VFihJQyMOUEUAnMtw6MVAov8uri9 7DTRdgd7MnUQjOnXo7eMIQuaPCrucZtBvbczBSXz7UfkyCyd4juAoBXQIsiFQ/Hz7eqd LWbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=Ai5m0LTY; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a630c46000000b00438ac3ec90fsi20092384pgm.484.2022.09.16.00.00.26; Fri, 16 Sep 2022 00:00:46 -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; dkim=fail header.i=@mit.edu header.s=outgoing header.b=Ai5m0LTY; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229725AbiIPGy7 (ORCPT + 99 others); Fri, 16 Sep 2022 02:54:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbiIPGy5 (ORCPT ); Fri, 16 Sep 2022 02:54:57 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 341373D594; Thu, 15 Sep 2022 23:54:55 -0700 (PDT) Received: from letrec.thunk.org ([185.122.133.20]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 28G6sHId010783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Sep 2022 02:54:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1663311263; bh=jqjwwvRnowqEU63Vd3ESTJA7Bt/dd4WUfiC93PuK8ls=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Ai5m0LTYmY21j+kf5nN3AizGJqlL/LrHVN1RgeEb+xCpZq0dS80CsVUaeGrp98Dzh /KpNaDuaR7sdPespuANIxRXxOyJEXCv8YP7HHs2NCGva/CMwd9ztDxuSA4uGkFo05H m+484K+K47AEq0mdO2BBceyISweo4B9/3sD3aRpUSS8DKXRwERiKgcvzzZ3t0zRzeb 4yhRPmfhY/O1AoNMNCo8EXkA4kIWgQA918ZNtRWlEzn9yy/oOXt0goj0JAxUXZ9wzi fn5oc7nYYk3Jh7xY+PyIyKNHh2Wy6eSJnvowA19Qdruqe56Le+KFdzwfNySaWQOCb7 TopHTQvd4l2ow== Received: by letrec.thunk.org (Postfix, from userid 15806) id 8A0D68C2B4B; Fri, 16 Sep 2022 02:54:16 -0400 (EDT) Date: Fri, 16 Sep 2022 02:54:16 -0400 From: "Theodore Ts'o" To: NeilBrown Cc: Jeff Layton , Trond Myklebust , "bfields@fieldses.org" , "zohar@linux.ibm.com" , "djwong@kernel.org" , "brauner@kernel.org" , "linux-xfs@vger.kernel.org" , "linux-api@vger.kernel.org" , "david@fromorbit.com" , "fweimer@redhat.com" , "linux-kernel@vger.kernel.org" , "chuck.lever@oracle.com" , "linux-man@vger.kernel.org" , "linux-nfs@vger.kernel.org" , "linux-ext4@vger.kernel.org" , "jack@suse.cz" , "viro@zeniv.linux.org.uk" , "xiubli@redhat.com" , "linux-fsdevel@vger.kernel.org" , "adilger.kernel@dilger.ca" , "lczerner@redhat.com" , "ceph-devel@vger.kernel.org" , "linux-btrfs@vger.kernel.org" Subject: Re: [man-pages RFC PATCH v4] statx, inode: document the new STATX_INO_VERSION field Message-ID: References: <20220912134208.GB9304@fieldses.org> <166302447257.30452.6751169887085269140@noble.neil.brown.name> <20220915140644.GA15754@fieldses.org> <577b6d8a7243aeee37eaa4bbb00c90799586bc48.camel@hammerspace.com> <1a968b8e87f054e360877c9ab8cdfc4cfdfc8740.camel@kernel.org> <0646410b6d2a5d19d3315f339b2928dfa9f2d922.camel@hammerspace.com> <34e91540c92ad6980256f6b44115cf993695d5e1.camel@kernel.org> <871f9c5153ddfe760854ca31ee36b84655959b83.camel@hammerspace.com> <166328063547.15759.12797959071252871549@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <166328063547.15759.12797959071252871549@noble.neil.brown.name> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 On Fri, Sep 16, 2022 at 08:23:55AM +1000, NeilBrown wrote: > > > If the answer is that 'all values change', then why store the crash > > > counter in the inode at all? Why not just add it as an offset when > > > you're generating the user-visible change attribute? > > > > > > i.e. statx.change_attr = inode->i_version + (crash counter * offset) I had suggested just hashing the crash counter with the file system's on-disk i_version number, which is essentially what you are suggested. > > Yes, if we plan to ensure that all the change attrs change after a > > crash, we can do that. > > > > So what would make sense for an offset? Maybe 2**12? One would hope that > > there wouldn't be more than 4k increments before one of them made it to > > disk. OTOH, maybe that can happen with teeny-tiny writes. > > Leave it up the to filesystem to decide. The VFS and/or NFSD should > have not have part in calculating the i_version. It should be entirely > in the filesystem - though support code could be provided if common > patterns exist across filesystems. Oh, *heck* no. This parameter is for the NFS implementation to decide, because it's NFS's caching algorithms which are at stake here. As a the file system maintainer, I had offered to make an on-disk "crash counter" which would get updated when the journal had gotten replayed, in addition to the on-disk i_version number. This will be available for the Linux implementation of NFSD to use, but that's up to *you* to decide how you want to use them. I was perfectly happy with hashing the crash counter and the i_version because I had assumed that not *that* much stuff was going to be cached, and so invalidating all of the caches in the unusual case where there was a crash was acceptable. After all it's a !@#?!@ cache. Caches sometimmes get invalidated. "That is the order of things." (as Ramata'Klan once said in "Rocks and Shoals") But if people expect that multiple TB's of data is going to be stored; that cache invalidation is unacceptable; and that a itsy-weeny chance of false negative failures which might cause data corruption might be acceptable tradeoff, hey, that's for the system which is providing caching semantics to determine. PLEASE don't put this tradeoff on the file system authors; I would much prefer to leave this tradeoff in the hands of the system which is trying to do the caching. - Ted