[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220823232832.GQ3600936@dread.disaster.area>
Date: Wed, 24 Aug 2022 09:28:32 +1000
From: Dave Chinner <david@...morbit.com>
To: NeilBrown <neilb@...e.de>
Cc: Jeff Layton <jlayton@...nel.org>, Mimi Zohar <zohar@...ux.ibm.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-integrity@...r.kernel.org, linux-nfs@...r.kernel.org,
linux-xfs@...r.kernel.org, linux-ext4@...r.kernel.org,
Trond Myklebust <trondmy@...merspace.com>
Subject: Re: [PATCH] iversion: update comments with info about atime updates
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@...morbit.com
Powered by blists - more mailing lists