[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whACfXMFPP+dPdsJmuF0F6g+YHfUtOxiESM+wxvZ22-GA@mail.gmail.com>
Date: Mon, 18 Sep 2023 15:10:16 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Jeff Layton <jlayton@...nel.org>
Cc: Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [GIT PULL] timestamp fixes
On Mon, 18 Sept 2023 at 13:56, Jeff Layton <jlayton@...nel.org> wrote:
>
> We may have a problem with the ctime update though, since you pointed it
> out. We have this in inode_set_ctime_current(), in the codepath where
> the QUERIED bit isn't set:
>
> /*
> * If we've recently updated with a fine-grained timestamp,
> * then the coarse-grained one may still be earlier than the
> * existing ctime. Just keep the existing value if so.
> */
> ctime.tv_sec = inode->__i_ctime.tv_sec;
> if (timespec64_compare(&ctime, &now) > 0)
> return ctime;
>
> The ctime can't be set via utimes(), so that's not an issue here, but we
> could get a realtime clock jump backward that causes this to not be
> updated like it should be.
>
> I think (like you suggest above) that this needs some bounds-checking
> where we make sure that the current coarse grained time isn't more than
> around 1-2 jiffies earlier than the existing ctime. If it is, then we'll
> go ahead and just update it anyway.
>
> Thoughts?
Ack, that sounds about right to me.
Christian - I'm just going to assume that you'll sort this out and
I'll get a new pull request at some point. Holler if you think
something else is needed, ok?
Linus
Powered by blists - more mailing lists