linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 00/26] xfsprogs: widen timestamps to deal with y2038
@ 2020-10-26 23:34 Darrick J. Wong
  2020-10-26 23:34 ` [PATCH 01/26] libxfs: create a real struct timespec64 Darrick J. Wong
                   ` (25 more replies)
  0 siblings, 26 replies; 58+ messages in thread
From: Darrick J. Wong @ 2020-10-26 23:34 UTC (permalink / raw)
  To: sandeen, darrick.wong
  Cc: Christoph Hellwig, Amir Goldstein, Allison Collins, Gao Xiang,
	Dave Chinner, linux-xfs

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
---
 db/Makefile                |    3 -
 db/command.c               |    1 
 db/command.h               |    1 
 db/dquot.c                 |    6 +
 db/field.c                 |   10 +-
 db/field.h                 |    1 
 db/fprint.c                |  133 +++++++++++++++++++++++++++----
 db/fprint.h                |    4 +
 db/inode.c                 |    9 +-
 db/sb.c                    |   17 ++++
 db/timelimit.c             |  160 +++++++++++++++++++++++++++++++++++++
 include/libxfs.h           |    1 
 include/platform_defs.h.in |    3 +
 include/xfs.h              |    2 
 include/xfs_fs_compat.h    |   12 +++
 include/xfs_inode.h        |   27 ++++--
 include/xfs_mount.h        |    5 +
 include/xqm.h              |   20 ++++-
 libfrog/bulkstat.h         |    4 +
 libfrog/convert.c          |    6 +
 libfrog/convert.h          |    2 
 libfrog/fsgeom.c           |    6 +
 libxfs/libxfs_api_defs.h   |    2 
 libxfs/libxfs_priv.h       |    2 
 libxfs/util.c              |    7 +-
 libxfs/xfs_dquot_buf.c     |   35 ++++++++
 libxfs/xfs_format.h        |  190 +++++++++++++++++++++++++++++++++++++++++++-
 libxfs/xfs_fs.h            |    1 
 libxfs/xfs_ialloc.c        |    4 +
 libxfs/xfs_inode_buf.c     |  130 ++++++++++++++----------------
 libxfs/xfs_inode_buf.h     |   15 +++
 libxfs/xfs_log_format.h    |    7 +-
 libxfs/xfs_quota_defs.h    |    8 ++
 libxfs/xfs_sb.c            |    2 
 libxfs/xfs_shared.h        |    3 +
 libxfs/xfs_trans_inode.c   |   11 +++
 logprint/log_misc.c        |   29 ++++++-
 logprint/log_print_all.c   |    3 -
 logprint/logprint.h        |    2 
 man/man8/mkfs.xfs.8        |   16 ++++
 man/man8/xfs_admin.8       |    5 +
 man/man8/xfs_db.8          |   23 +++++
 mkfs/xfs_mkfs.c            |   24 +++++-
 quota/edit.c               |   79 +++++++++++++++---
 quota/quota.c              |   16 ++--
 quota/quota.h              |    9 ++
 quota/report.c             |   16 ++--
 quota/util.c               |    5 +
 repair/dinode.c            |   40 ++++++++-
 repair/quotacheck.c        |   11 ++-
 scrub/common.c             |    2 
 scrub/fscounters.c         |    1 
 scrub/inodes.c             |    5 -
 scrub/progress.c           |    1 
 54 files changed, 959 insertions(+), 178 deletions(-)
 create mode 100644 db/timelimit.c


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

end of thread, other threads:[~2020-11-24  0:35 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 23:34 [PATCH v6 00/26] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
2020-10-26 23:34 ` [PATCH 01/26] libxfs: create a real struct timespec64 Darrick J. Wong
2020-10-29  9:44   ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 02/26] libxfs: refactor NSEC_PER_SEC Darrick J. Wong
2020-10-29  9:44   ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 03/26] libfrog: define LIBFROG_BULKSTAT_CHUNKSIZE to remove dependence on XFS_INODES_PER_CHUNK Darrick J. Wong
2020-10-29  9:45   ` Christoph Hellwig
2020-10-29  9:45     ` Christoph Hellwig
2020-10-29 17:25       ` Darrick J. Wong
2020-10-30  8:20         ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 04/26] libfrog: convert cvttime to return time64_t Darrick J. Wong
2020-10-29  9:45   ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 05/26] xfs_quota: convert time_to_string to use time64_t Darrick J. Wong
2020-10-29  9:47   ` Christoph Hellwig
2020-10-29 17:32     ` Darrick J. Wong
2020-10-30  8:21       ` Christoph Hellwig
2020-11-16 20:45   ` Eric Sandeen
2020-10-26 23:34 ` [PATCH 06/26] xfs_db: refactor timestamp printing Darrick J. Wong
2020-10-29  9:47   ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 07/26] xfs_db: refactor quota timer printing Darrick J. Wong
2020-10-29  9:48   ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 08/26] xfs_logprint: refactor timestamp printing Darrick J. Wong
2020-10-29  9:48   ` Christoph Hellwig
2020-11-23 20:14   ` Eric Sandeen
2020-11-24  0:25     ` Darrick J. Wong
2020-10-26 23:35 ` [PATCH 09/26] xfs: explicitly define inode timestamp range Darrick J. Wong
2020-10-26 23:35 ` [PATCH 10/26] xfs: refactor quota expiration timer modification Darrick J. Wong
2020-10-26 23:35 ` [PATCH 11/26] xfs: refactor default quota grace period setting code Darrick J. Wong
2020-10-26 23:35 ` [PATCH 12/26] xfs: refactor quota timestamp coding Darrick J. Wong
2020-10-26 23:35 ` [PATCH 13/26] xfs: move xfs_log_dinode_to_disk to the log recovery code Darrick J. Wong
2020-10-26 23:35 ` [PATCH 14/26] xfs: redefine xfs_timestamp_t Darrick J. Wong
2020-10-26 23:35 ` [PATCH 15/26] xfs: redefine xfs_ictimestamp_t Darrick J. Wong
2020-10-26 23:35 ` [PATCH 16/26] xfs: widen ondisk inode timestamps to deal with y2038+ Darrick J. Wong
2020-10-26 23:35 ` [PATCH 17/26] xfs: widen ondisk quota expiration timestamps to handle y2038+ Darrick J. Wong
2020-10-26 23:36 ` [PATCH 18/26] libxfs: propagate bigtime inode flag when allocating Darrick J. Wong
2020-10-29  9:48   ` Christoph Hellwig
2020-10-26 23:36 ` [PATCH 19/26] libfrog: list the bigtime feature when reporting geometry Darrick J. Wong
2020-10-29  9:49   ` Christoph Hellwig
2020-10-26 23:36 ` [PATCH 20/26] xfs_db: report bigtime format timestamps Darrick J. Wong
2020-10-29  9:50   ` Christoph Hellwig
2020-10-29 17:45     ` Darrick J. Wong
2020-10-30  8:23       ` Christoph Hellwig
2020-11-16 21:16   ` Eric Sandeen
2020-11-16 22:41     ` Darrick J. Wong
2020-11-17 17:45   ` [PATCH v2 " Darrick J. Wong
2020-11-17 18:18     ` Eric Sandeen
2020-10-26 23:36 ` [PATCH 21/26] xfs_db: support printing time limits Darrick J. Wong
2020-10-29  9:50   ` Christoph Hellwig
2020-10-26 23:36 ` [PATCH 22/26] xfs_db: add bigtime upgrade path Darrick J. Wong
2020-10-29  9:51   ` Christoph Hellwig
2020-11-16 21:15   ` [PATCH v2 " Darrick J. Wong
2020-10-26 23:36 ` [PATCH 23/26] xfs_quota: support editing and reporting quotas with bigtime Darrick J. Wong
2020-10-29  9:51   ` Christoph Hellwig
2020-10-26 23:36 ` [PATCH 24/26] xfs_repair: support bigtime timestamp checking Darrick J. Wong
2020-10-29  9:52   ` Christoph Hellwig
2020-10-26 23:36 ` [PATCH 25/26] mkfs: format bigtime filesystems Darrick J. Wong
2020-10-29  9:52   ` Christoph Hellwig
2020-10-26 23:36 ` [PATCH 26/26] xfs: enable big timestamps 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).