Re: [PATCH v2 00/11] xfs: widen timestamps to deal with y2038

Dave Chinner
2020-08-18T23:01:30Z

On Mon, Aug 17, 2020 at 03:56:48PM -0700, Darrick J. Wong wrote:
> Hi all,
>
> This series performs some refactoring of our timestamp and inode
> encoding functions, then retrofits the timestamp union to handle
> timestamps as a 64-bit nanosecond counter. Next, it adds bit shifting
> to the non-root dquot timer fields to boost their effective size to 34
> bits. These two changes enable correct time handling on XFS through the
> year 2486.

A bit more detail would be nice :)

Like, the inode timestamp has a range of slightly greater than 2^34
because 10^9 < 2^30. i.e.

Inode timestamp range in days:

$ echo $(((2**62 / (1000*1000*1000) / 86400) * 2**2))
213500
$

While the quota timer range in days is:
$ echo $(((2**34 / 86400)))
198841
$

There's ~15,000 days difference in range here, which in years is
about 40 years. Hence the inodes have a timestamp range out to
~2485 from the 1901 epoch start, while quota timers have a range
out to only 2445 from the epoch start.

Some discussion of the different ranges, the problems it might cause
and why we don't have to worry about it would be appreciated :)

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com