public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: NeilBrown <neilb@suse.de>
Cc: Jeff Layton <jlayton@kernel.org>,
	Mimi Zohar <zohar@linux.ibm.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-integrity@vger.kernel.org, linux-nfs@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org,
	Trond Myklebust <trondmy@hammerspace.com>
Subject: Re: [PATCH] iversion: update comments with info about atime updates
Date: Wed, 24 Aug 2022 09:28:32 +1000	[thread overview]
Message-ID: <20220823232832.GQ3600936@dread.disaster.area> (raw)
In-Reply-To: <166129348704.23264.10381335282721356873@noble.neil.brown.name>

On Wed, Aug 24, 2022 at 08:24:47AM +1000, NeilBrown wrote:
> On Tue, 23 Aug 2022, Jeff Layton wrote:
> > On Tue, 2022-08-23 at 21:38 +1000, NeilBrown wrote:
> > > On Tue, 23 Aug 2022, Jeff Layton wrote:
> > > > So, we can refer to that and simply say:
> > > > 
> > > > "If the function updates the mtime or ctime on the inode, then the
> > > > i_version should be incremented. If only the atime is being updated,
> > > > then the i_version should not be incremented. The exception to this rule
> > > > is explicit atime updates via utimes() or similar mechanism, which
> > > > should result in the i_version being incremented."
> > > 
> > > Is that exception needed?  utimes() updates ctime.
> > > 
> > > https://man7.org/linux/man-pages/man2/utimes.2.html
> > > 
> > > doesn't say that, but
> > > 
> > > https://pubs.opengroup.org/onlinepubs/007904875/functions/utimes.html
> > > 
> > > does, as does the code.
> > > 
> > 
> > Oh, good point! I think we can leave that out. Even better!
> 
> Further, implicit mtime updates (file_update_time()) also update ctime.
> So all you need is
>    If the function updates the ctime, then i_version should be
>    incremented.
> 
> and I have to ask - why not just use the ctime?  Why have another number
> that is parallel?
> 
> Timestamps are updated at HZ (ktime_get_course) which is at most every
> millisecond.

Kernel time, and therefore timestamps, can go backwards.

-Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2022-08-23 23:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22 13:33 [PATCH] iversion: update comments with info about atime updates Jeff Layton
2022-08-22 15:40 ` Mimi Zohar
2022-08-22 16:22   ` Jeff Layton
2022-08-22 17:39     ` Mimi Zohar
2022-08-22 18:22       ` Jeff Layton
2022-08-22 23:32         ` Dave Chinner
2022-08-23 11:21           ` Jeff Layton
2022-08-23 11:38             ` NeilBrown
2022-08-23 11:51               ` Jeff Layton
2022-08-23 22:24                 ` NeilBrown
2022-08-23 23:28                   ` Dave Chinner [this message]
2022-08-23 23:42                     ` NeilBrown
2022-08-24  0:11                       ` Trond Myklebust
2022-08-24 12:53                   ` Jeff Layton
2022-08-25  0:17                     ` NeilBrown
2022-08-23 23:25             ` Dave Chinner
2022-08-24 12:45               ` Jeff Layton
2022-08-22 22:42 ` NeilBrown
2022-08-22 23:26   ` Trond Myklebust

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=20220823232832.GQ3600936@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=jlayton@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-integrity@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=trondmy@hammerspace.com \
    --cc=zohar@linux.ibm.com \
    /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