Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp268808rdb; Thu, 2 Nov 2023 03:18:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMhYxpTqzIQDhwI0ViEqlpjrJZNyjfg3phFP8ySebHHqRmgVmrtWxImvHrS5S6M0k6Yt+4 X-Received: by 2002:a17:90a:ed03:b0:27d:1822:f3de with SMTP id kq3-20020a17090aed0300b0027d1822f3demr14915569pjb.16.1698920284277; Thu, 02 Nov 2023 03:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698920284; cv=none; d=google.com; s=arc-20160816; b=ZBRZDx0JpTKbVOSoY9lbGtfoNGSk/QVhIRbfDzFVKb57v1eOMKJPbWaBByaVEVXD+r DJTd5wWP5aWQ4YpRx5UdRD607ws0Ebt7GNaDTMk9zCXEtVnUqq2gsWE43AhhffiCo2xZ PajUb9c1PAIFkpbWm6rVu69Nx5u6F39t4yEsIXGOtD7gmXVIez2Rl63v9cz9qpJHJ9Kf C5CvOH/7QsCNKzgVhKGyU21hs3RKTLi3llRt65JWtRTPQdlUUGlc3Globzvlt/YqCq8V M6nPo1TSQEfmcG5lGxM0QEBIErFtQrjSa8BnBzW0kPz6LRRySo4ywaaG6cYIdVDMkVO6 r4hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=61/9S/iDtfMGs3XXVZxTN7mTzXiiomqomKOvz2hZd1E=; fh=rPUA0LcnM8SKlPlAHDAid0wiAnNy20+yk0pUSm3WXqo=; b=GrXnV/7VW28rqiWrlSpZh3yVXks6Tkz2IvYTvoOtRe99zD4scK3BSN1e7yjIIKoZW2 QOLTtEsqvzEt+jMzB6w2/2KmuCl6Is0HJzu3MjRjLy5lrJ2Y3VkwIaCg8jRiOfCQisZB r+Jtr9EF/9LTbIsGSwd5Yc+pK0EUDPh+wN/l1VwwTdQlnbl0Jb+XTw8mD0Wzs5QUMPRX yy55wn2Cdy6Rl5U38OOO2Oj5+mihCcv5glrFOCNp9e0yaSdFKcUNzZrHATPxAFMheGXb HSsx5N3tRQGpj7UIBMT3LvYB0sLa+CeFdVv3FmuvoF2WhjiqCV1JC1NGWz2OY1agko3l sKIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GPzXf+02; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id lr7-20020a17090b4b8700b00280ca5f4ca5si2601526pjb.113.2023.11.02.03.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 03:18:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GPzXf+02; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4E5B98212AA1; Thu, 2 Nov 2023 03:18:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346329AbjKBKSD (ORCPT + 99 others); Thu, 2 Nov 2023 06:18:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346318AbjKBKSC (ORCPT ); Thu, 2 Nov 2023 06:18:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00A31128; Thu, 2 Nov 2023 03:17:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42655C433C8; Thu, 2 Nov 2023 10:17:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698920276; bh=bpWiJO3vrZtaIhf4lJAzkNfBmBiB4Rlew74U352mP2c=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=GPzXf+02TCcU8r7ah904XYsjziscTwo8ubIMx0FnRpAc0grUJB/LjtGbUvypwzPWH z2YGVH+Ieghb7Zv8phNGcsZo29LVQp/tUIkwbgrRts8XVe0VPs8Ln/n+1DqHBiDgCQ GkeZKPYeW1hxdR7F51croDYL7gTK40NJo0vo/TjFs4zUFq9SPFfx9nCBsUz54pqcFZ IjmMGHHIGM9YLTJ+Qmd5jyiQrDbf69piUW4JCbvNhBWw6UUr7YnzF3c1T2MkcWYMWf AVnlg5GKxgAMrRf7y9VnmNDhbKnB7WDGuraRJr0U3ut39E/oV6N8iyoCLIDPbeuhqL FKjqFi4uhzMCg== Message-ID: <3ec97baef1ebbbd7ace97a7d7023bf3f36e1cbc7.camel@kernel.org> Subject: Re: [PATCH RFC 2/9] timekeeping: new interfaces for multigrain timestamp handing From: Jeff Layton To: Amir Goldstein , Jan Kara Cc: Dave Chinner , Linus Torvalds , Kent Overstreet , Christian Brauner , Alexander Viro , John Stultz , Thomas Gleixner , Stephen Boyd , Chandan Babu R , "Darrick J. Wong" , Theodore Ts'o , Andreas Dilger , Chris Mason , Josef Bacik , David Sterba , Hugh Dickins , Andrew Morton , Jan Kara , David Howells , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org Date: Thu, 02 Nov 2023 06:17:53 -0400 In-Reply-To: References: <2ef9ac6180e47bc9cc8edef20648a000367c4ed2.camel@kernel.org> <6df5ea54463526a3d898ed2bd8a005166caa9381.camel@kernel.org> <3d6a4c21626e6bbb86761a6d39e0fafaf30a4a4d.camel@kernel.org> <20231101101648.zjloqo5su6bbxzff@quack3> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 03:18:03 -0700 (PDT) On Wed, 2023-11-01 at 13:38 +0200, Amir Goldstein wrote: > On Wed, Nov 1, 2023 at 12:16=E2=80=AFPM Jan Kara wrote: > >=20 > > On Wed 01-11-23 08:57:09, Dave Chinner wrote: > > > 5. When-ever the inode is persisted, the timestamp is copied to the > > > on-disk structure and the current change counter is folded in. > > >=20 > > > This means the on-disk structure always contains the latest > > > change attribute that has been persisted, just like we > > > currently do with i_version now. > > >=20 > > > 6. When-ever we read the inode off disk, we split the change counter > > > from the timestamp and update the appropriate internal structures > > > with this information. > > >=20 > > > This ensures that the VFS and userspace never see the change > > > counter implementation in the inode timestamps. > >=20 > > OK, but is this compatible with the current XFS behavior? AFAICS curren= tly > > XFS sets sb->s_time_gran to 1 so timestamps currently stored on disk wi= ll > > have some mostly random garbage in low bits of the ctime. Now if you lo= ok > > at such inode with a kernel using this new scheme, stat(2) will report > > ctime with low bits zeroed-out so if the ctime fetched in the old kerne= l was > > stored in some external database and compared to the newly fetched ctim= e, it > > will appear that ctime has gone backwards... Maybe we don't care but it= is > > a user visible change that can potentially confuse something. >=20 > See xfs_inode_has_bigtime() and auto-upgrade of inode format in > xfs_inode_item_precommit(). >=20 > In the case of BIGTIME inode format, admin needs to opt-in to > BIGTIME format conversion by setting an INCOMPAT_BIGTIME > sb feature flag. >=20 > I imagine that something similar (inode flag + sb flag) would need > to be done for the versioned-timestamp, but I think that in that case, > the feature flag could be RO_COMPAT - there is no harm in exposing > made-up nsec lower bits if fs would be mounted read-only on an old > kernel, is there? >=20 > The same RO_COMPAT feature flag could also be used to determine > s_time_gran, because IIUC, s_time_gran for timestamp updates > is uniform across all inodes. >=20 > I know that Dave said he wants to avoid changing on-disk format, > but I am hoping that this well defined and backward compat with > lazy upgrade, on-disk format change may be acceptable? With the ctime, we're somewhat saved by the fact that it's not settable by users, so we don't need to worry as much about returning specific values there, I think. With the scheme Dave is proposing, booting to a new kernel vs. an old kernel might show a different ctime on an inode though. That might be enough to justify needing a way to opt-in to the change on existing filesystems. --=20 Jeff Layton