Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp429549rdh; Sat, 23 Sep 2023 17:50:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEYFQFZcYwLlAT6B2ngBdBcl/x7lMc0VVeBZBcFHkfJy0/21ArgjE7jlULqDgy8Scff+gN0 X-Received: by 2002:a17:902:d507:b0:1c3:dafa:b1e9 with SMTP id b7-20020a170902d50700b001c3dafab1e9mr3959096plg.10.1695516657886; Sat, 23 Sep 2023 17:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695516657; cv=none; d=google.com; s=arc-20160816; b=CRnB7OE0zDChLDxK4OKNLZ/ChL384AZhD/CpmqXUOuqvR2jVXcyAmkybBp7ekgZNb/ eEEIyykh3mwqrOdwk5b08ypoS1HjObD117QhPyBkqMSRHPBdoav/YxEIYc18ehaisgGb 2D2wFjxEE2PEnwnXcA5Cp9k8cn84tulrXpnuDPBst33Nysiezq0fmBZRKyld3qNK20Gr oe+QMknKkowq/vcnNGu2NgoWY8EGDNmQPuCpNjvMGy4tbDSUFetA1ZBD/9CdOQLmBu+p y2ZzfS67XtP8vxQ1p2CwnV+AlouL7jy7xh9sZD20HRUW9kG4OzbhCRue7Ty2YcuOpKSK I78g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=N5fh3KTYudy9uf30WQHLYoA6WKrTKy0P0fUHqm5/Lms=; fh=GH/wnMKVWCyfCkjV03+HmULyuv07NRZy9lQsDcrc5Ao=; b=cSLpVWPZ8TsNaefpX1URVD8Pmzy+lqg9qhVNiQ9Iz85pOPaiAHMB1NaUVz30YJl9Jt 6/150BkS22smFxv6etjCiVU23o6KwXSFTWPjEAkswBqnQgkfihDifRHsTOUFQEv47jpS XeoNSmy3S7w780152H/5BixR3g3lwiY/XaxQEtH8iFEiPvnOIVcp2RhF+nVoHXysIL93 tpcL7woLIv1ilBGlO+32crQ8RSJ7LDQhaa4HjYZVu28oA+Y6e5NiugXLlHlg1r6zmm1r 8NURBCfj6l0PcbN4+aL3tq9ICbu8ZQnwAVqZNTK7ONpYvkt0OkK9MZ080jpM46GSyDy/ 3F8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ltFotPsV; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id f1-20020a170902f38100b001c46ce1a50bsi6257365ple.20.2023.09.23.17.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 17:50:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ltFotPsV; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id EDB7D8255494; Sat, 23 Sep 2023 13:43:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229460AbjIWUnY (ORCPT + 99 others); Sat, 23 Sep 2023 16:43:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjIWUnY (ORCPT ); Sat, 23 Sep 2023 16:43:24 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F23B11B; Sat, 23 Sep 2023 13:43:18 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3ae31be5ee9so703560b6e.2; Sat, 23 Sep 2023 13:43:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695501797; x=1696106597; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=N5fh3KTYudy9uf30WQHLYoA6WKrTKy0P0fUHqm5/Lms=; b=ltFotPsVYDAf/sIAjYkeCoMf1OKvvdQ5atbusBNuJqlFU9iHbT3sbo5Zs+ynd9kGmI OHScMeCB16Mb+U7hk3/Cd5q7uZhz1eiXdL4iPztN7ADQCGACrhZp2/OFzTdBEIOTd/sm jN7A/B1k3eV92DtqsIFLy68d/9NPo1DUYqfRKWFlJN05cY3W8otlKdDtHWXdFlJIT5ZG eY3ls7tM4YQOtx6chVwZp7qhsXABm0Hoc345j+OIAAwGc3Paa3q2vdU6GMfaSt2MQbih eVKsBm0h1Z63LxsTBgGlefx/e0uUGQf1utprMvCzUZq4Ag4u2OksPWmufm1RU5EVbySK NUhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695501797; x=1696106597; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N5fh3KTYudy9uf30WQHLYoA6WKrTKy0P0fUHqm5/Lms=; b=kqiznan2vdFG67xb3scscUWj7rphEGR+FieUpiBRbHIvYPjPDqfcq1CTupWO2s1H/S ffMJy1pt68vcm2LWVBxS4xV1b3pnMlYGGteoEe58vsTDd93+VXoLsaI9A1fOiu36LQ+V X5bmGq4pEIiWF+r1aLwpVDxKpz1WLEzFQTuNeVpl+haQl7hoMcHWSwXscaRNMbrwz+nW FCDtcadjFZ4VyV0PIuKic4yTMN9wHPQnR1jYtcL2KcFHn3r7GHO6Q6GfY3O7ds98JYYE +4TOi1WQ+o2TqngImd0gXXA4ZeZlF3p9AQKOVp/VyZopT4LDLQFfsWfQeTAtX0JyfkvN kjmw== X-Gm-Message-State: AOJu0Yxhn4sWcmoZdI16Bcu91tsN/4bNY84k80L2uusUp2Cmn/H8N+1t 7kWj4RM54W4ylefX9zPiAvZeH0Q/+SUgTX5wAmk= X-Received: by 2002:a05:6808:199f:b0:3a8:4d1f:9dd0 with SMTP id bj31-20020a056808199f00b003a84d1f9dd0mr4316251oib.30.1695501797512; Sat, 23 Sep 2023 13:43:17 -0700 (PDT) MIME-Version: 1.0 References: <20230922-ctime-v8-0-45f0c236ede1@kernel.org> <5e3b8a365160344f1188ff13afb0a26103121f99.camel@kernel.org> In-Reply-To: <5e3b8a365160344f1188ff13afb0a26103121f99.camel@kernel.org> From: Amir Goldstein Date: Sat, 23 Sep 2023 23:43:06 +0300 Message-ID: Subject: Re: [PATCH v8 0/5] fs: multigrain timestamps for XFS's change_cookie To: Jeff Layton Cc: Alexander Viro , Christian Brauner , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Chandan Babu R , "Darrick J. Wong" , Dave Chinner , Jan Kara , Linus Torvalds , Kent Overstreet , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-xfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 23 Sep 2023 13:43:25 -0700 (PDT) On Sat, Sep 23, 2023 at 1:46=E2=80=AFPM Jeff Layton wr= ote: > > On Sat, 2023-09-23 at 10:15 +0300, Amir Goldstein wrote: > > On Fri, Sep 22, 2023 at 8:15=E2=80=AFPM Jeff Layton wrote: > > > > > > My initial goal was to implement multigrain timestamps on most major > > > filesystems, so we could present them to userland, and use them for > > > NFSv3, etc. > > > > > > With the current implementation however, we can't guarantee that a fi= le > > > with a coarse grained timestamp modified after one with a fine graine= d > > > timestamp will always appear to have a later value. This could confus= e > > > some programs like make, rsync, find, etc. that depend on strict > > > ordering requirements for timestamps. > > > > > > The goal of this version is more modest: fix XFS' change attribute. > > > XFS's change attribute is bumped on atime updates in addition to othe= r > > > deliberate changes. This makes it unsuitable for export via nfsd. > > > > > > Jan Kara suggested keeping this functionality internal-only for now a= nd > > > plumbing the fine grained timestamps through getattr [1]. This set ta= kes > > > a slightly different approach and has XFS use the fine-grained attr t= o > > > fake up STATX_CHANGE_COOKIE in its getattr routine itself. > > > > > > While we keep fine-grained timestamps in struct inode, when presentin= g > > > the timestamps via getattr, we truncate them at a granularity of numb= er > > > of ns per jiffy, > > > > That's not good, because user explicitly set granular mtime would be > > truncated too and booting with different kernels (HZ) would change > > the observed timestamps of files. > > > > Thinking about this some more, I think the first problem is easily > addressable: > > The ctime isn't explicitly settable and with this set, we're already not > truncating the atime. We haven't used any of the extra bits in the mtime > yet, so we could just carve out a flag in there that says "this mtime > was explicitly set and shouldn't be truncated before presentation". > > The second problem (booting to older kernel) is a bit tougher to deal > with however. I'll have to think about that one a bit more. There is a straightforward solution to both these problems - opt in with a mount option to truncate user visible timestamps to 100ns (and not jiffy) resolution as Linus is trying to promote. Thanks, Amir.