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

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

 



On Mon, Aug 31, 2020 at 11:07:14AM +0300, Amir Goldstein wrote:
> On Mon, Aug 31, 2020 at 9:08 AM Darrick J. Wong <darrick.wong@xxxxxxxxxx> 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.
> >
> > On a current V5 filesystem, inodes timestamps are a signed 32-bit
> > seconds counter, with 0 being the Unix epoch.  Quota timers are an
> > unsigned 32-bit seconds counter, with 0 also being the Unix epoch.
> >
> > This means that inode timestamps can range from:
> > -(2^31-1) (13 Dec 1901) through (2^31-1) (19 Jan 2038).
> >
> > And quota timers can range from:
> > 0 (1 Jan 1970) through (2^32-1) (7 Feb 2106).
> >
> > With the bigtime encoding turned on, inode timestamps are an unsigned
> > 64-bit nanoseconds counter, with 0 being the 1901 epoch.  Quota timers
> > are a 34-bit unsigned second counter right shifted two bits, with 0
> > being the Unix epoch, and capped at the maximum inode timestamp value.
> >
> > This means that inode timestamps can range from:
> > 0 (13 Dec 1901) through (2^64-1 / 1e9) (2 Jul 2486)
> >
> > Quota timers could theoretically range from:
> > 0 (1 Jan 1970) through (((2^34-1) + (2^31-1)) & ~3) (16 Jun 2582).
> >
> > But with the capping in place, the quota timers maximum is:
> > max((2^64-1 / 1e9) - (2^31-1), (((2^34-1) + (2^31-1)) & ~3) (2 Jul 2486).
> >
> > v2: rebase to 5.9, having landed the quota refactoring
> > v3: various suggestions by Amir and Dave
> > v4: drop the timestamp unions, add "is bigtime?" predicates everywhere
> > v5: reintroduce timestamp unions as *legacy* timestamp unions
> 
> I went over the relevant patches briefly.
> I do not have time for thorough re-review and seems like you have enough
> reviewers already, but wanted to say that IMO v5 is "approachable" for
> novice xfs developers and I can follow the conversions easily, so that's
> probably a good thing ;-)

<nod> Thanks for the review!  Good to see you at LPC last week too!

--D

> Thanks,
> Amir.



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux