From: Dave Chinner <david@fromorbit.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
Chuck Lever <chuck.lever@oracle.com>, Neil Brown <neilb@suse.de>,
Olga Kornievskaia <kolga@netapp.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
Chandan Babu R <chandan.babu@oracle.com>,
"Darrick J. Wong" <djwong@kernel.org>, Jan Kara <jack@suse.cz>,
Linus Torvalds <torvalds@linux-foundation.org>,
Kent Overstreet <kent.overstreet@linux.dev>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-nfs@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH v8 0/5] fs: multigrain timestamps for XFS's change_cookie
Date: Mon, 25 Sep 2023 08:18:14 +1000 [thread overview]
Message-ID: <ZRC1pjwKRzLiD6I3@dread.disaster.area> (raw)
In-Reply-To: <CAOQ4uxjrt6ca4VDvPAL7USr6_SspCv0rkRkMJ4_W2S6vzV738g@mail.gmail.com>
On Sat, Sep 23, 2023 at 05:52:36PM +0300, Amir Goldstein wrote:
> On Sat, Sep 23, 2023 at 1:46 PM Jeff Layton <jlayton@kernel.org> wrote:
> >
> > On Sat, 2023-09-23 at 10:15 +0300, Amir Goldstein wrote:
> > > On Fri, Sep 22, 2023 at 8:15 PM Jeff Layton <jlayton@kernel.org> 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 file
> > > > with a coarse grained timestamp modified after one with a fine grained
> > > > timestamp will always appear to have a later value. This could confuse
> > > > 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 other
> > > > deliberate changes. This makes it unsuitable for export via nfsd.
> > > >
> > > > Jan Kara suggested keeping this functionality internal-only for now and
> > > > plumbing the fine grained timestamps through getattr [1]. This set takes
> > > > a slightly different approach and has XFS use the fine-grained attr to
> > > > fake up STATX_CHANGE_COOKIE in its getattr routine itself.
> > > >
> > > > While we keep fine-grained timestamps in struct inode, when presenting
> > > > the timestamps via getattr, we truncate them at a granularity of number
> > > > 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".
> >
>
> I thought about this option too.
> But note that the "mtime was explicitly set" flag needs
> to be persisted to disk so you cannot store it in the high nsec bits.
> At least XFS won't store those bits if you use them - they have to
> be translated to an XFS inode flag and I don't know if changing
> XFS on-disk format was on your wish list.
Remember: this multi-grain timestamp thing was an idea to solve the
NFS change attribute problem without requiring *any* filesystem with
sub-jiffie timestamp capability to change their on-disk format to
implement a persistent change attribute that matches the new
requires of the kernel nfsd.
If we now need to change the on-disk format to support
some whacky new timestamp semantic to do this, then people have
completely lost sight of what problem the multi-grain timestamp idea
was supposed to address.
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2023-09-24 22:18 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-22 17:14 Jeff Layton
2023-09-22 17:14 ` [PATCH v8 1/5] fs: add infrastructure for multigrain timestamps Jeff Layton
2023-09-22 17:31 ` Kent Overstreet
2023-09-22 18:22 ` Jeff Layton
2023-09-22 17:14 ` [PATCH v8 2/5] fs: optimize away some fine-grained timestamp updates Jeff Layton
2023-09-22 17:14 ` [PATCH v8 3/5] fs: have setattr_copy handle multigrain timestamps appropriately Jeff Layton
2023-09-22 17:14 ` [PATCH v8 4/5] fs: add timestamp_truncate_to_gran helper Jeff Layton
2023-09-22 17:14 ` [PATCH v8 5/5] xfs: switch to multigrain timestamps Jeff Layton
2023-09-23 7:15 ` [PATCH v8 0/5] fs: multigrain timestamps for XFS's change_cookie Amir Goldstein
2023-09-23 10:22 ` Jeff Layton
2023-09-23 14:58 ` Amir Goldstein
2023-09-25 10:08 ` Jeff Layton
2023-09-23 10:46 ` Jeff Layton
2023-09-23 14:52 ` Amir Goldstein
2023-09-24 22:18 ` Dave Chinner [this message]
2023-09-25 10:14 ` Jeff Layton
2023-09-25 22:32 ` Dave Chinner
2023-09-26 11:31 ` Jeff Layton
2023-09-26 23:33 ` Dave Chinner
2023-09-27 10:26 ` Jeff Layton
2023-09-23 20:43 ` Amir Goldstein
2023-09-24 11:31 ` Christian Brauner
2023-09-24 22:44 ` NeilBrown
2023-09-25 10:17 ` Jeff Layton
2023-09-26 12:10 ` Christian Brauner
2023-09-26 12:18 ` Christian Brauner
2023-09-26 12:51 ` Jeff Layton
2023-09-26 14:29 ` Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZRC1pjwKRzLiD6I3@dread.disaster.area \
--to=david@fromorbit.com \
--cc=Dai.Ngo@oracle.com \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=chandan.babu@oracle.com \
--cc=chuck.lever@oracle.com \
--cc=djwong@kernel.org \
--cc=jack@suse.cz \
--cc=jlayton@kernel.org \
--cc=kent.overstreet@linux.dev \
--cc=kolga@netapp.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=tom@talpey.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®