Re: [PATCH v2 1/2] t5319: replace 'touch -m' with 'test-tool chmtime'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 01, 2020 at 08:06:47PM -0400, Derrick Stolee wrote:

> > Also, in the best case (i.e. original timestamp of A/B/C/D are the
> > same), the above seems to assume that the filesystem has at least 1
> > second file timestamp granularity.  Do we want to make them at least
> > 2 seconds apart, or am I worried too much about ancient filesystems
> > that no longer metter?
> 
> The old test relied on one-second granularity, so that hasn't changed.
> I could easily space it out a bit more without issue.
> 
> Your concern about the original timestamps getting skewed shouldn't
> be an issue because "test-tool chmtime =-<seconds>" subtracts the
> <seconds> from the current system time, not the file's mtime. This
> is subtle: without the "=" it would modify it from the file's mtime.
> 
> Since we are assigning the offset values in the proper order (D to A)
> there isn't an issue if time ticks forward between these steps.

I wonder if that would run afoul of the same "mtime and system clock are
not quite the same" issue we saw recently in [1].

I think it might not because we're only comparing mtimes set through the
same mechanism (find the system time, subtract from it, and assign to
mtime). If system time is monotonically increasing at any rate, that
would produce the desired effect.

That said, it seems so easy to just give it a 10 second (or even 10
minute) spread to avoid any possibility of confusion.

-Peff

[1] https://lore.kernel.org/git/pull.725.git.git.1584125875550.gitgitgadget@xxxxxxxxx/



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux