fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET v4 0/4] fstests: widen timestamps to deal with y2038+
@ 2021-04-21  0:23 Darrick J. Wong
  2021-04-21  0:23 ` [PATCH 1/4] generic: check userspace handling of extreme timestamps Darrick J. Wong
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Darrick J. Wong @ 2021-04-21  0:23 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: Amir Goldstein, linux-xfs, fstests, guan

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).

v1: Initial RFC.
v2: Expand explanations due to questions from Amir.
v3: Fix a bunch more things that Amir pointed out.
v4: Fix some review comments from Amir and Eryu.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=bigtime

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=bigtime

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=bigtime
---
 common/rc             |    2 -
 common/xfs            |   35 ++++++++++++
 tests/generic/721     |  123 ++++++++++++++++++++++++++++++++++++++++
 tests/generic/721.out |    2 +
 tests/generic/722     |  125 +++++++++++++++++++++++++++++++++++++++++
 tests/generic/722.out |    1 
 tests/generic/group   |    6 +-
 tests/xfs/122         |    1 
 tests/xfs/122.out     |    1 
 tests/xfs/908         |  117 ++++++++++++++++++++++++++++++++++++++
 tests/xfs/908.out     |   29 ++++++++++
 tests/xfs/909         |  149 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/909.out     |    6 ++
 tests/xfs/911         |   44 ++++++++++++++
 tests/xfs/911.out     |   15 +++++
 tests/xfs/group       |    3 +
 16 files changed, 656 insertions(+), 3 deletions(-)
 create mode 100755 tests/generic/721
 create mode 100644 tests/generic/721.out
 create mode 100755 tests/generic/722
 create mode 100644 tests/generic/722.out
 create mode 100755 tests/xfs/908
 create mode 100644 tests/xfs/908.out
 create mode 100755 tests/xfs/909
 create mode 100644 tests/xfs/909.out
 create mode 100755 tests/xfs/911
 create mode 100644 tests/xfs/911.out


^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCHSET 0/4] fstests: widen timestamps to deal with y2038+
@ 2021-03-31  1:08 Darrick J. Wong
  2021-03-31  1:08 ` [PATCH 1/4] generic: check userspace handling of extreme timestamps Darrick J. Wong
  0 siblings, 1 reply; 20+ messages in thread
From: Darrick J. Wong @ 2021-03-31  1:08 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: Amir Goldstein, linux-xfs, fstests, guan

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).

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=bigtime

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=bigtime

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=bigtime
---
 common/rc             |    2 -
 common/xfs            |   32 +++++++++++
 tests/generic/721     |  123 ++++++++++++++++++++++++++++++++++++++++
 tests/generic/721.out |    2 +
 tests/generic/722     |  125 +++++++++++++++++++++++++++++++++++++++++
 tests/generic/722.out |    1 
 tests/generic/group   |    6 +-
 tests/xfs/122         |    1 
 tests/xfs/122.out     |    1 
 tests/xfs/908         |   97 ++++++++++++++++++++++++++++++++
 tests/xfs/908.out     |   20 +++++++
 tests/xfs/909         |  149 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/909.out     |    6 ++
 tests/xfs/911         |   44 ++++++++++++++
 tests/xfs/911.out     |   15 +++++
 tests/xfs/group       |    3 +
 16 files changed, 624 insertions(+), 3 deletions(-)
 create mode 100755 tests/generic/721
 create mode 100644 tests/generic/721.out
 create mode 100755 tests/generic/722
 create mode 100644 tests/generic/722.out
 create mode 100755 tests/xfs/908
 create mode 100644 tests/xfs/908.out
 create mode 100755 tests/xfs/909
 create mode 100644 tests/xfs/909.out
 create mode 100755 tests/xfs/911
 create mode 100644 tests/xfs/911.out


^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH RFC v6 0/4] xfstests: widen timestamps to deal with y2038+
@ 2020-10-27 19:03 Darrick J. Wong
  2020-10-27 19:04 ` [PATCH 1/4] generic: check userspace handling of extreme timestamps Darrick J. Wong
  0 siblings, 1 reply; 20+ messages in thread
From: Darrick J. Wong @ 2020-10-27 19:03 UTC (permalink / raw)
  To: darrick.wong, guaneryu; +Cc: linux-xfs, fstests

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
v6: minor stylistic changes

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=bigtime

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=bigtime

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=bigtime
---
 common/rc             |    2 -
 common/xfs            |   30 ++++++++++
 tests/generic/721     |  117 +++++++++++++++++++++++++++++++++++++
 tests/generic/721.out |    1 
 tests/generic/722     |  120 ++++++++++++++++++++++++++++++++++++++
 tests/generic/722.out |    1 
 tests/generic/group   |    2 +
 tests/xfs/122         |    1 
 tests/xfs/122.out     |    1 
 tests/xfs/908         |   87 ++++++++++++++++++++++++++++
 tests/xfs/908.out     |   10 +++
 tests/xfs/909         |  153 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/909.out     |    4 +
 tests/xfs/911         |   44 ++++++++++++++
 tests/xfs/911.out     |   15 +++++
 tests/xfs/group       |    3 +
 16 files changed, 590 insertions(+), 1 deletion(-)
 create mode 100755 tests/generic/721
 create mode 100644 tests/generic/721.out
 create mode 100755 tests/generic/722
 create mode 100644 tests/generic/722.out
 create mode 100755 tests/xfs/908
 create mode 100644 tests/xfs/908.out
 create mode 100755 tests/xfs/909
 create mode 100644 tests/xfs/909.out
 create mode 100755 tests/xfs/911
 create mode 100644 tests/xfs/911.out


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-04-25 15:42 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21  0:23 [PATCHSET v4 0/4] fstests: widen timestamps to deal with y2038+ Darrick J. Wong
2021-04-21  0:23 ` [PATCH 1/4] generic: check userspace handling of extreme timestamps Darrick J. Wong
2021-04-22 21:16   ` Allison Henderson
2021-04-23  1:07     ` Darrick J. Wong
2021-04-21  0:23 ` [PATCH 2/4] xfs/122: add legacy timestamps to ondisk checker Darrick J. Wong
2021-04-22 21:16   ` Allison Henderson
2021-04-21  0:23 ` [PATCH 3/4] xfs: detect time limits from filesystem Darrick J. Wong
2021-04-22 21:16   ` Allison Henderson
2021-04-21  0:23 ` [PATCH 4/4] xfs: test upgrading filesystem to bigtime Darrick J. Wong
2021-04-21  6:18   ` Amir Goldstein
2021-04-21 16:41     ` Darrick J. Wong
2021-04-22 21:16   ` Allison Henderson
2021-04-25  7:21   ` Eryu Guan
2021-04-25 15:42     ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2021-03-31  1:08 [PATCHSET 0/4] fstests: widen timestamps to deal with y2038+ Darrick J. Wong
2021-03-31  1:08 ` [PATCH 1/4] generic: check userspace handling of extreme timestamps Darrick J. Wong
2020-10-27 19:03 [PATCH RFC v6 0/4] xfstests: widen timestamps to deal with y2038+ Darrick J. Wong
2020-10-27 19:04 ` [PATCH 1/4] generic: check userspace handling of extreme timestamps Darrick J. Wong
2020-10-29 10:34   ` Amir Goldstein
2020-10-29 21:00     ` Darrick J. Wong
2020-10-29 21:40       ` Amir Goldstein
2020-10-29 21:59         ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).