All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038
@ 2020-08-17 22:58 Darrick J. Wong
  2020-08-17 22:58 ` [PATCH 01/18] libxfs: create a real struct timespec64 Darrick J. Wong
                   ` (17 more replies)
  0 siblings, 18 replies; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 22:58 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: 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.

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                |    2 -
 db/command.c               |    1 
 db/command.h               |    1 
 db/dquot.c                 |   31 ++++++++-
 db/field.c                 |    8 ++
 db/field.h                 |    3 +
 db/fprint.c                |  120 +++++++++++++++++++++++++++++++++++
 db/fprint.h                |    6 ++
 db/inode.c                 |   30 ++++++++-
 db/sb.c                    |   15 ++++
 db/timelimit.c             |  152 ++++++++++++++++++++++++++++++++++++++++++++
 include/libxfs.h           |    1 
 include/platform_defs.h.in |    3 +
 include/xfs_inode.h        |   22 +++---
 include/xfs_mount.h        |    5 +
 libfrog/fsgeom.c           |    6 +-
 libxfs/libxfs_api_defs.h   |   14 ++++
 libxfs/libxfs_priv.h       |    2 -
 libxfs/util.c              |   10 ++-
 libxfs/xfs_dquot_buf.c     |   60 +++++++++++++++++
 libxfs/xfs_format.h        |  139 +++++++++++++++++++++++++++++++++++++---
 libxfs/xfs_fs.h            |    1 
 libxfs/xfs_inode_buf.c     |  132 +++++++++++++++++++-------------------
 libxfs/xfs_inode_buf.h     |    7 +-
 libxfs/xfs_log_format.h    |   21 ++++--
 libxfs/xfs_quota_defs.h    |    9 ++-
 libxfs/xfs_sb.c            |    2 +
 man/man8/mkfs.xfs.8        |   16 +++++
 man/man8/xfs_admin.8       |    5 +
 man/man8/xfs_db.8          |   23 +++++++
 mkfs/xfs_mkfs.c            |   24 +++++++
 repair/dinode.c            |   25 ++++++-
 scrub/common.c             |    2 -
 scrub/progress.c           |    1 
 34 files changed, 772 insertions(+), 127 deletions(-)
 create mode 100644 db/timelimit.c


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

* [PATCH 01/18] libxfs: create a real struct timespec64
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
@ 2020-08-17 22:58 ` Darrick J. Wong
  2020-08-18 14:19   ` Amir Goldstein
  2020-08-17 22:59 ` [PATCH 02/18] xfs: explicitly define inode timestamp range Darrick J. Wong
                   ` (16 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 22:58 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Create a real struct timespec64 that supports 64-bit seconds counts.
The C library struct timespec doesn't support this on 32-bit
architectures and we cannot lose the upper bits in the incore inode.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 include/libxfs.h         |    1 -
 include/xfs_inode.h      |   22 +++++++++++-----------
 libxfs/libxfs_api_defs.h |    7 +++++++
 libxfs/libxfs_priv.h     |    2 --
 4 files changed, 18 insertions(+), 14 deletions(-)


diff --git a/include/libxfs.h b/include/libxfs.h
index b9370139becc..2667d3b77084 100644
--- a/include/libxfs.h
+++ b/include/libxfs.h
@@ -41,7 +41,6 @@ struct iomap;
 #define __round_mask(x, y) ((__typeof__(x))((y)-1))
 #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
 #define unlikely(x) (x)
-#define timespec64 timespec
 
 /*
  * This mirrors the kernel include for xfs_buf.h - it's implicitly included in
diff --git a/include/xfs_inode.h b/include/xfs_inode.h
index 588d8c7258f4..12676cb30bf2 100644
--- a/include/xfs_inode.h
+++ b/include/xfs_inode.h
@@ -31,17 +31,17 @@ struct xfs_inode_log_item;
  * metadata.
  */
 struct inode {
-	mode_t		i_mode;
-	uint32_t	i_uid;
-	uint32_t	i_gid;
-	uint32_t	i_nlink;
-	xfs_dev_t	i_rdev;		/* This actually holds xfs_dev_t */
-	unsigned long	i_state;	/* Not actually used in userspace */
-	uint32_t	i_generation;
-	uint64_t	i_version;
-	struct timespec	i_atime;
-	struct timespec	i_mtime;
-	struct timespec	i_ctime;
+	mode_t			i_mode;
+	uint32_t		i_uid;
+	uint32_t		i_gid;
+	uint32_t		i_nlink;
+	xfs_dev_t		i_rdev;	 /* This actually holds xfs_dev_t */
+	unsigned long		i_state; /* Not actually used in userspace */
+	uint32_t		i_generation;
+	uint64_t		i_version;
+	struct timespec64	i_atime;
+	struct timespec64	i_mtime;
+	struct timespec64	i_ctime;
 };
 
 static inline uint32_t i_uid_read(struct inode *inode)
diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h
index a3eef04db419..99bc5b936da7 100644
--- a/libxfs/libxfs_api_defs.h
+++ b/libxfs/libxfs_api_defs.h
@@ -7,6 +7,13 @@
 #ifndef __LIBXFS_API_DEFS_H__
 #define __LIBXFS_API_DEFS_H__
 
+typedef long long int time64_t;
+
+struct timespec64 {
+	time64_t	tv_sec;			/* seconds */
+	long		tv_nsec;		/* nanoseconds */
+};
+
 /*
  * This file defines all the kernel based functions we expose to userspace
  * via the libxfs_* namespace. This is kept in a separate header file so
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index eb485e7375b1..808b78180b06 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -64,8 +64,6 @@ extern kmem_zone_t *xfs_buf_zone;
 extern kmem_zone_t *xfs_inode_zone;
 extern kmem_zone_t *xfs_trans_zone;
 
-#define timespec64 timespec
-
 /* fake up iomap, (not) used in xfs_bmap.[ch] */
 #define IOMAP_F_SHARED			0x04
 #define xfs_bmbt_to_iomap(a, b, c, d)	((void) 0)


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

* [PATCH 02/18] xfs: explicitly define inode timestamp range
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
  2020-08-17 22:58 ` [PATCH 01/18] libxfs: create a real struct timespec64 Darrick J. Wong
@ 2020-08-17 22:59 ` Darrick J. Wong
  2020-08-18 14:17   ` Amir Goldstein
  2020-08-17 22:59 ` [PATCH 03/18] xfs: refactor quota expiration timer modification Darrick J. Wong
                   ` (15 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 22:59 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Formally define the inode timestamp ranges that existing filesystems
support, and switch the vfs timetamp ranges to use it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/libxfs_api_defs.h |    4 ++++
 libxfs/xfs_format.h      |   19 +++++++++++++++++++
 2 files changed, 23 insertions(+)


diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h
index 99bc5b936da7..4ee02473df0d 100644
--- a/libxfs/libxfs_api_defs.h
+++ b/libxfs/libxfs_api_defs.h
@@ -14,6 +14,10 @@ struct timespec64 {
 	long		tv_nsec;		/* nanoseconds */
 };
 
+#define U32_MAX		((uint32_t)~0U)
+#define S32_MAX		((int32_t)(U32_MAX >> 1))
+#define S32_MIN		((int32_t)(-S32_MAX - 1))
+
 /*
  * This file defines all the kernel based functions we expose to userspace
  * via the libxfs_* namespace. This is kept in a separate header file so
diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
index 88cbcb7950c3..f2a851e49ec3 100644
--- a/libxfs/xfs_format.h
+++ b/libxfs/xfs_format.h
@@ -849,11 +849,30 @@ struct xfs_agfl {
 	    ASSERT(xfs_daddr_to_agno(mp, d) == \
 		   xfs_daddr_to_agno(mp, (d) + (len) - 1)))
 
+/*
+ * XFS Timestamps
+ * ==============
+ *
+ * Inode timestamps consist of signed 32-bit counters for seconds and
+ * nanoseconds; time zero is the Unix epoch, Jan  1 00:00:00 UTC 1970.
+ */
 typedef struct xfs_timestamp {
 	__be32		t_sec;		/* timestamp seconds */
 	__be32		t_nsec;		/* timestamp nanoseconds */
 } xfs_timestamp_t;
 
+/*
+ * Smallest possible timestamp with traditional timestamps, which is
+ * Dec 13 20:45:52 UTC 1901.
+ */
+#define XFS_INO_TIME_MIN	((int64_t)S32_MIN)
+
+/*
+ * Largest possible timestamp with traditional timestamps, which is
+ * Jan 19 03:14:07 UTC 2038.
+ */
+#define XFS_INO_TIME_MAX	((int64_t)S32_MAX)
+
 /*
  * On-disk inode structure.
  *


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

* [PATCH 03/18] xfs: refactor quota expiration timer modification
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
  2020-08-17 22:58 ` [PATCH 01/18] libxfs: create a real struct timespec64 Darrick J. Wong
  2020-08-17 22:59 ` [PATCH 02/18] xfs: explicitly define inode timestamp range Darrick J. Wong
@ 2020-08-17 22:59 ` Darrick J. Wong
  2020-08-18 14:21   ` Amir Goldstein
  2020-08-17 22:59 ` [PATCH 04/18] xfs: refactor default quota grace period setting code Darrick J. Wong
                   ` (14 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 22:59 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Define explicit limits on the range of quota grace period expiration
timeouts and refactor the code that modifies the timeouts into helpers
that clamp the values appropriately.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/xfs_format.h |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)


diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
index f2a851e49ec3..829eb1e035a5 100644
--- a/libxfs/xfs_format.h
+++ b/libxfs/xfs_format.h
@@ -1198,6 +1198,28 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
 
 #define XFS_DQTYPE_ANY		(XFS_DQTYPE_REC_MASK)
 
+/*
+ * XFS Quota Timers
+ * ================
+ *
+ * Quota grace period expiration timers are an unsigned 32-bit seconds counter;
+ * time zero is the Unix epoch, Jan  1 00:00:01 UTC 1970.  An expiration value
+ * of zero means that the quota limit has not been reached, and therefore no
+ * expiration has been set.
+ */
+
+/*
+ * Smallest possible quota expiration with traditional timestamps, which is
+ * Jan  1 00:00:01 UTC 1970.
+ */
+#define XFS_DQ_TIMEOUT_MIN	((int64_t)1)
+
+/*
+ * Largest possible quota expiration with traditional timestamps, which is
+ * Feb  7 06:28:15 UTC 2106.
+ */
+#define XFS_DQ_TIMEOUT_MAX	((int64_t)U32_MAX)
+
 /*
  * This is the main portion of the on-disk representation of quota information
  * for a user.  We pad this with some more expansion room to construct the on


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

* [PATCH 04/18] xfs: refactor default quota grace period setting code
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (2 preceding siblings ...)
  2020-08-17 22:59 ` [PATCH 03/18] xfs: refactor quota expiration timer modification Darrick J. Wong
@ 2020-08-17 22:59 ` Darrick J. Wong
  2020-08-18 14:23   ` Amir Goldstein
  2020-08-17 22:59 ` [PATCH 05/18] xfs: remove xfs_timestamp_t Darrick J. Wong
                   ` (13 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 22:59 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Refactor the code that sets the default quota grace period into a helper
function so that we can override the ondisk behavior later.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/xfs_format.h |   13 +++++++++++++
 1 file changed, 13 insertions(+)


diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
index 829eb1e035a5..a60d4ed40946 100644
--- a/libxfs/xfs_format.h
+++ b/libxfs/xfs_format.h
@@ -1206,6 +1206,11 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
  * time zero is the Unix epoch, Jan  1 00:00:01 UTC 1970.  An expiration value
  * of zero means that the quota limit has not been reached, and therefore no
  * expiration has been set.
+ *
+ * The grace period for each quota type is stored in the root dquot (id = 0)
+ * and is applied to a non-root dquot when it exceeds the soft or hard limits.
+ * The length of quota grace periods are unsigned 32-bit quantities measured in
+ * units of seconds.  A value of zero means to use the default period.
  */
 
 /*
@@ -1220,6 +1225,14 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
  */
 #define XFS_DQ_TIMEOUT_MAX	((int64_t)U32_MAX)
 
+/*
+ * Default quota grace periods, ranging from zero (use the compiled defaults)
+ * to ~136 years.  These are applied to a non-root dquot that has exceeded
+ * either limit.
+ */
+#define XFS_DQ_GRACE_MIN	((int64_t)0)
+#define XFS_DQ_GRACE_MAX	((int64_t)U32_MAX)
+
 /*
  * This is the main portion of the on-disk representation of quota information
  * for a user.  We pad this with some more expansion room to construct the on


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

* [PATCH 05/18] xfs: remove xfs_timestamp_t
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (3 preceding siblings ...)
  2020-08-17 22:59 ` [PATCH 04/18] xfs: refactor default quota grace period setting code Darrick J. Wong
@ 2020-08-17 22:59 ` Darrick J. Wong
  2020-08-18 14:24   ` Amir Goldstein
  2020-08-17 22:59 ` [PATCH 06/18] xfs: move xfs_log_dinode_to_disk to the log code Darrick J. Wong
                   ` (12 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 22:59 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Kill this old typedef.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 db/field.c              |    2 +-
 db/inode.c              |    2 +-
 libxfs/xfs_format.h     |   12 ++++++------
 libxfs/xfs_log_format.h |   12 ++++++------
 4 files changed, 14 insertions(+), 14 deletions(-)


diff --git a/db/field.c b/db/field.c
index aa0154d82eb7..0f41be636db4 100644
--- a/db/field.c
+++ b/db/field.c
@@ -350,7 +350,7 @@ const ftattr_t	ftattrtab[] = {
 	{ FLDT_TIME, "time", fp_time, NULL, SI(bitsz(int32_t)), FTARG_SIGNED,
 	  NULL, NULL },
 	{ FLDT_TIMESTAMP, "timestamp", NULL, (char *)timestamp_flds,
-	  SI(bitsz(xfs_timestamp_t)), 0, NULL, timestamp_flds },
+	  SI(bitsz(struct xfs_timestamp)), 0, NULL, timestamp_flds },
 	{ FLDT_UINT1, "uint1", fp_num, "%u", SI(1), 0, NULL, NULL },
 	{ FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(uint16_t)), 0, NULL,
 	  NULL },
diff --git a/db/inode.c b/db/inode.c
index f13150c96aa9..dfaf12816d75 100644
--- a/db/inode.c
+++ b/db/inode.c
@@ -179,7 +179,7 @@ const field_t	inode_v3_flds[] = {
 };
 
 
-#define	TOFF(f)	bitize(offsetof(xfs_timestamp_t, t_ ## f))
+#define	TOFF(f)	bitize(offsetof(struct xfs_timestamp, t_ ## f))
 const field_t	timestamp_flds[] = {
 	{ "sec", FLDT_TIME, OI(TOFF(sec)), C1, 0, TYP_NONE },
 	{ "nsec", FLDT_NSEC, OI(TOFF(nsec)), C1, 0, TYP_NONE },
diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
index a60d4ed40946..d11adbbd1808 100644
--- a/libxfs/xfs_format.h
+++ b/libxfs/xfs_format.h
@@ -856,10 +856,10 @@ struct xfs_agfl {
  * Inode timestamps consist of signed 32-bit counters for seconds and
  * nanoseconds; time zero is the Unix epoch, Jan  1 00:00:00 UTC 1970.
  */
-typedef struct xfs_timestamp {
+struct xfs_timestamp {
 	__be32		t_sec;		/* timestamp seconds */
 	__be32		t_nsec;		/* timestamp nanoseconds */
-} xfs_timestamp_t;
+};
 
 /*
  * Smallest possible timestamp with traditional timestamps, which is
@@ -904,9 +904,9 @@ typedef struct xfs_dinode {
 	__be16		di_projid_hi;	/* higher part owner's project id */
 	__u8		di_pad[6];	/* unused, zeroed space */
 	__be16		di_flushiter;	/* incremented on flush */
-	xfs_timestamp_t	di_atime;	/* time last accessed */
-	xfs_timestamp_t	di_mtime;	/* time last modified */
-	xfs_timestamp_t	di_ctime;	/* time created/inode modified */
+	struct xfs_timestamp di_atime;	/* time last accessed */
+	struct xfs_timestamp di_mtime;	/* time last modified */
+	struct xfs_timestamp di_ctime;	/* time created/inode modified */
 	__be64		di_size;	/* number of bytes in file */
 	__be64		di_nblocks;	/* # of direct & btree blocks used */
 	__be32		di_extsize;	/* basic/minimum extent size for file */
@@ -931,7 +931,7 @@ typedef struct xfs_dinode {
 	__u8		di_pad2[12];	/* more padding for future expansion */
 
 	/* fields only written to during inode creation */
-	xfs_timestamp_t	di_crtime;	/* time created */
+	struct xfs_timestamp di_crtime;	/* time created */
 	__be64		di_ino;		/* inode number */
 	uuid_t		di_uuid;	/* UUID of the filesystem */
 
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index e3400c9c71cd..f2fac9bea66d 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -368,10 +368,10 @@ static inline int xfs_ilog_fdata(int w)
  * directly mirrors the xfs_dinode structure as it must contain all the same
  * information.
  */
-typedef struct xfs_ictimestamp {
+struct xfs_ictimestamp {
 	int32_t		t_sec;		/* timestamp seconds */
 	int32_t		t_nsec;		/* timestamp nanoseconds */
-} xfs_ictimestamp_t;
+};
 
 /*
  * Define the format of the inode core that is logged. This structure must be
@@ -390,9 +390,9 @@ struct xfs_log_dinode {
 	uint16_t	di_projid_hi;	/* higher part of owner's project id */
 	uint8_t		di_pad[6];	/* unused, zeroed space */
 	uint16_t	di_flushiter;	/* incremented on flush */
-	xfs_ictimestamp_t di_atime;	/* time last accessed */
-	xfs_ictimestamp_t di_mtime;	/* time last modified */
-	xfs_ictimestamp_t di_ctime;	/* time created/inode modified */
+	struct xfs_ictimestamp di_atime;	/* time last accessed */
+	struct xfs_ictimestamp di_mtime;	/* time last modified */
+	struct xfs_ictimestamp di_ctime;	/* time created/inode modified */
 	xfs_fsize_t	di_size;	/* number of bytes in file */
 	xfs_rfsblock_t	di_nblocks;	/* # of direct & btree blocks used */
 	xfs_extlen_t	di_extsize;	/* basic/minimum extent size for file */
@@ -417,7 +417,7 @@ struct xfs_log_dinode {
 	uint8_t		di_pad2[12];	/* more padding for future expansion */
 
 	/* fields only written to during inode creation */
-	xfs_ictimestamp_t di_crtime;	/* time created */
+	struct xfs_ictimestamp di_crtime;	/* time created */
 	xfs_ino_t	di_ino;		/* inode number */
 	uuid_t		di_uuid;	/* UUID of the filesystem */
 


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

* [PATCH 06/18] xfs: move xfs_log_dinode_to_disk to the log code
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (4 preceding siblings ...)
  2020-08-17 22:59 ` [PATCH 05/18] xfs: remove xfs_timestamp_t Darrick J. Wong
@ 2020-08-17 22:59 ` Darrick J. Wong
  2020-08-18 14:26   ` Amir Goldstein
  2020-08-17 22:59 ` [PATCH 07/18] xfs: refactor inode timestamp coding Darrick J. Wong
                   ` (11 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 22:59 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Move this function to xfs_inode_item.c to match the encoding function
that's already there.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/xfs_inode_buf.c |   52 ------------------------------------------------
 libxfs/xfs_inode_buf.h |    2 --
 2 files changed, 54 deletions(-)


diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
index 110f249df98c..ecb9abd82a3e 100644
--- a/libxfs/xfs_inode_buf.c
+++ b/libxfs/xfs_inode_buf.c
@@ -311,58 +311,6 @@ xfs_inode_to_disk(
 	}
 }
 
-void
-xfs_log_dinode_to_disk(
-	struct xfs_log_dinode	*from,
-	struct xfs_dinode	*to)
-{
-	to->di_magic = cpu_to_be16(from->di_magic);
-	to->di_mode = cpu_to_be16(from->di_mode);
-	to->di_version = from->di_version;
-	to->di_format = from->di_format;
-	to->di_onlink = 0;
-	to->di_uid = cpu_to_be32(from->di_uid);
-	to->di_gid = cpu_to_be32(from->di_gid);
-	to->di_nlink = cpu_to_be32(from->di_nlink);
-	to->di_projid_lo = cpu_to_be16(from->di_projid_lo);
-	to->di_projid_hi = cpu_to_be16(from->di_projid_hi);
-	memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad));
-
-	to->di_atime.t_sec = cpu_to_be32(from->di_atime.t_sec);
-	to->di_atime.t_nsec = cpu_to_be32(from->di_atime.t_nsec);
-	to->di_mtime.t_sec = cpu_to_be32(from->di_mtime.t_sec);
-	to->di_mtime.t_nsec = cpu_to_be32(from->di_mtime.t_nsec);
-	to->di_ctime.t_sec = cpu_to_be32(from->di_ctime.t_sec);
-	to->di_ctime.t_nsec = cpu_to_be32(from->di_ctime.t_nsec);
-
-	to->di_size = cpu_to_be64(from->di_size);
-	to->di_nblocks = cpu_to_be64(from->di_nblocks);
-	to->di_extsize = cpu_to_be32(from->di_extsize);
-	to->di_nextents = cpu_to_be32(from->di_nextents);
-	to->di_anextents = cpu_to_be16(from->di_anextents);
-	to->di_forkoff = from->di_forkoff;
-	to->di_aformat = from->di_aformat;
-	to->di_dmevmask = cpu_to_be32(from->di_dmevmask);
-	to->di_dmstate = cpu_to_be16(from->di_dmstate);
-	to->di_flags = cpu_to_be16(from->di_flags);
-	to->di_gen = cpu_to_be32(from->di_gen);
-
-	if (from->di_version == 3) {
-		to->di_changecount = cpu_to_be64(from->di_changecount);
-		to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec);
-		to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec);
-		to->di_flags2 = cpu_to_be64(from->di_flags2);
-		to->di_cowextsize = cpu_to_be32(from->di_cowextsize);
-		to->di_ino = cpu_to_be64(from->di_ino);
-		to->di_lsn = cpu_to_be64(from->di_lsn);
-		memcpy(to->di_pad2, from->di_pad2, sizeof(to->di_pad2));
-		uuid_copy(&to->di_uuid, &from->di_uuid);
-		to->di_flushiter = 0;
-	} else {
-		to->di_flushiter = cpu_to_be16(from->di_flushiter);
-	}
-}
-
 static xfs_failaddr_t
 xfs_dinode_verify_fork(
 	struct xfs_dinode	*dip,
diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h
index 6b08b9d060c2..89f7bea8efd6 100644
--- a/libxfs/xfs_inode_buf.h
+++ b/libxfs/xfs_inode_buf.h
@@ -49,8 +49,6 @@ void	xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *);
 void	xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to,
 			  xfs_lsn_t lsn);
 int	xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from);
-void	xfs_log_dinode_to_disk(struct xfs_log_dinode *from,
-			       struct xfs_dinode *to);
 
 xfs_failaddr_t xfs_dinode_verify(struct xfs_mount *mp, xfs_ino_t ino,
 			   struct xfs_dinode *dip);


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

* [PATCH 07/18] xfs: refactor inode timestamp coding
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (5 preceding siblings ...)
  2020-08-17 22:59 ` [PATCH 06/18] xfs: move xfs_log_dinode_to_disk to the log code Darrick J. Wong
@ 2020-08-17 22:59 ` Darrick J. Wong
  2020-08-18 14:28   ` Amir Goldstein
  2020-08-17 22:59 ` [PATCH 08/18] xfs: convert struct xfs_timestamp to union Darrick J. Wong
                   ` (10 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 22:59 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Refactor inode timestamp encoding and decoding into helper functions so
that we can add extra behaviors in subsequent patches.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/xfs_inode_buf.c |   42 ++++++++++++++++++++++++++----------------
 libxfs/xfs_inode_buf.h |    5 +++++
 2 files changed, 31 insertions(+), 16 deletions(-)


diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
index ecb9abd82a3e..9f7309f9a576 100644
--- a/libxfs/xfs_inode_buf.c
+++ b/libxfs/xfs_inode_buf.c
@@ -158,6 +158,15 @@ xfs_imap_to_bp(
 	return 0;
 }
 
+void
+xfs_inode_from_disk_timestamp(
+	struct timespec64		*tv,
+	const struct xfs_timestamp	*ts)
+{
+	tv->tv_sec = (int)be32_to_cpu(ts->t_sec);
+	tv->tv_nsec = (int)be32_to_cpu(ts->t_nsec);
+}
+
 int
 xfs_inode_from_disk(
 	struct xfs_inode	*ip,
@@ -212,12 +221,9 @@ xfs_inode_from_disk(
 	 * a time before epoch is converted to a time long after epoch
 	 * on 64 bit systems.
 	 */
-	inode->i_atime.tv_sec = (int)be32_to_cpu(from->di_atime.t_sec);
-	inode->i_atime.tv_nsec = (int)be32_to_cpu(from->di_atime.t_nsec);
-	inode->i_mtime.tv_sec = (int)be32_to_cpu(from->di_mtime.t_sec);
-	inode->i_mtime.tv_nsec = (int)be32_to_cpu(from->di_mtime.t_nsec);
-	inode->i_ctime.tv_sec = (int)be32_to_cpu(from->di_ctime.t_sec);
-	inode->i_ctime.tv_nsec = (int)be32_to_cpu(from->di_ctime.t_nsec);
+	xfs_inode_from_disk_timestamp(&inode->i_atime, &from->di_atime);
+	xfs_inode_from_disk_timestamp(&inode->i_mtime, &from->di_mtime);
+	xfs_inode_from_disk_timestamp(&inode->i_ctime, &from->di_ctime);
 
 	to->di_size = be64_to_cpu(from->di_size);
 	to->di_nblocks = be64_to_cpu(from->di_nblocks);
@@ -230,8 +236,7 @@ xfs_inode_from_disk(
 	if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
 		inode_set_iversion_queried(inode,
 					   be64_to_cpu(from->di_changecount));
-		to->di_crtime.tv_sec = be32_to_cpu(from->di_crtime.t_sec);
-		to->di_crtime.tv_nsec = be32_to_cpu(from->di_crtime.t_nsec);
+		xfs_inode_from_disk_timestamp(&to->di_crtime, &from->di_crtime);
 		to->di_flags2 = be64_to_cpu(from->di_flags2);
 		to->di_cowextsize = be32_to_cpu(from->di_cowextsize);
 	}
@@ -253,6 +258,15 @@ xfs_inode_from_disk(
 	return error;
 }
 
+void
+xfs_inode_to_disk_timestamp(
+	struct xfs_timestamp		*ts,
+	const struct timespec64		*tv)
+{
+	ts->t_sec = cpu_to_be32(tv->tv_sec);
+	ts->t_nsec = cpu_to_be32(tv->tv_nsec);
+}
+
 void
 xfs_inode_to_disk(
 	struct xfs_inode	*ip,
@@ -272,12 +286,9 @@ xfs_inode_to_disk(
 	to->di_projid_hi = cpu_to_be16(from->di_projid >> 16);
 
 	memset(to->di_pad, 0, sizeof(to->di_pad));
-	to->di_atime.t_sec = cpu_to_be32(inode->i_atime.tv_sec);
-	to->di_atime.t_nsec = cpu_to_be32(inode->i_atime.tv_nsec);
-	to->di_mtime.t_sec = cpu_to_be32(inode->i_mtime.tv_sec);
-	to->di_mtime.t_nsec = cpu_to_be32(inode->i_mtime.tv_nsec);
-	to->di_ctime.t_sec = cpu_to_be32(inode->i_ctime.tv_sec);
-	to->di_ctime.t_nsec = cpu_to_be32(inode->i_ctime.tv_nsec);
+	xfs_inode_to_disk_timestamp(&to->di_atime, &inode->i_atime);
+	xfs_inode_to_disk_timestamp(&to->di_mtime, &inode->i_mtime);
+	xfs_inode_to_disk_timestamp(&to->di_ctime, &inode->i_ctime);
 	to->di_nlink = cpu_to_be32(inode->i_nlink);
 	to->di_gen = cpu_to_be32(inode->i_generation);
 	to->di_mode = cpu_to_be16(inode->i_mode);
@@ -296,8 +307,7 @@ xfs_inode_to_disk(
 	if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
 		to->di_version = 3;
 		to->di_changecount = cpu_to_be64(inode_peek_iversion(inode));
-		to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.tv_sec);
-		to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.tv_nsec);
+		xfs_inode_to_disk_timestamp(&to->di_crtime, &from->di_crtime);
 		to->di_flags2 = cpu_to_be64(from->di_flags2);
 		to->di_cowextsize = cpu_to_be32(from->di_cowextsize);
 		to->di_ino = cpu_to_be64(ip->i_ino);
diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h
index 89f7bea8efd6..9c63f3f932d7 100644
--- a/libxfs/xfs_inode_buf.h
+++ b/libxfs/xfs_inode_buf.h
@@ -58,4 +58,9 @@ xfs_failaddr_t xfs_inode_validate_cowextsize(struct xfs_mount *mp,
 		uint32_t cowextsize, uint16_t mode, uint16_t flags,
 		uint64_t flags2);
 
+void xfs_inode_from_disk_timestamp(struct timespec64 *tv,
+		const struct xfs_timestamp *ts);
+void xfs_inode_to_disk_timestamp(struct xfs_timestamp *ts,
+		const struct timespec64 *tv);
+
 #endif	/* __XFS_INODE_BUF_H__ */


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

* [PATCH 08/18] xfs: convert struct xfs_timestamp to union
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (6 preceding siblings ...)
  2020-08-17 22:59 ` [PATCH 07/18] xfs: refactor inode timestamp coding Darrick J. Wong
@ 2020-08-17 22:59 ` Darrick J. Wong
  2020-08-18 14:29   ` Amir Goldstein
  2020-08-17 22:59 ` [PATCH 09/18] libxfs: refactor NSEC_PER_SEC Darrick J. Wong
                   ` (9 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 22:59 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Convert the xfs_timestamp struct to a union so that we can overload it
in the next patch.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 db/field.c              |    2 +-
 db/inode.c              |    2 +-
 libxfs/xfs_format.h     |   16 +++++++++-------
 libxfs/xfs_inode_buf.c  |    4 ++--
 libxfs/xfs_inode_buf.h  |    4 ++--
 libxfs/xfs_log_format.h |   16 +++++++++-------
 repair/dinode.c         |    2 +-
 7 files changed, 25 insertions(+), 21 deletions(-)


diff --git a/db/field.c b/db/field.c
index 0f41be636db4..cf3002c730e6 100644
--- a/db/field.c
+++ b/db/field.c
@@ -350,7 +350,7 @@ const ftattr_t	ftattrtab[] = {
 	{ FLDT_TIME, "time", fp_time, NULL, SI(bitsz(int32_t)), FTARG_SIGNED,
 	  NULL, NULL },
 	{ FLDT_TIMESTAMP, "timestamp", NULL, (char *)timestamp_flds,
-	  SI(bitsz(struct xfs_timestamp)), 0, NULL, timestamp_flds },
+	  SI(bitsz(union xfs_timestamp)), 0, NULL, timestamp_flds },
 	{ FLDT_UINT1, "uint1", fp_num, "%u", SI(1), 0, NULL, NULL },
 	{ FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(uint16_t)), 0, NULL,
 	  NULL },
diff --git a/db/inode.c b/db/inode.c
index dfaf12816d75..25112bb5e4d8 100644
--- a/db/inode.c
+++ b/db/inode.c
@@ -179,7 +179,7 @@ const field_t	inode_v3_flds[] = {
 };
 
 
-#define	TOFF(f)	bitize(offsetof(struct xfs_timestamp, t_ ## f))
+#define	TOFF(f)	bitize(offsetof(union xfs_timestamp, t_ ## f))
 const field_t	timestamp_flds[] = {
 	{ "sec", FLDT_TIME, OI(TOFF(sec)), C1, 0, TYP_NONE },
 	{ "nsec", FLDT_NSEC, OI(TOFF(nsec)), C1, 0, TYP_NONE },
diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
index d11adbbd1808..5403d3412cb6 100644
--- a/libxfs/xfs_format.h
+++ b/libxfs/xfs_format.h
@@ -856,9 +856,11 @@ struct xfs_agfl {
  * Inode timestamps consist of signed 32-bit counters for seconds and
  * nanoseconds; time zero is the Unix epoch, Jan  1 00:00:00 UTC 1970.
  */
-struct xfs_timestamp {
-	__be32		t_sec;		/* timestamp seconds */
-	__be32		t_nsec;		/* timestamp nanoseconds */
+union xfs_timestamp {
+	struct {
+		__be32		t_sec;		/* timestamp seconds */
+		__be32		t_nsec;		/* timestamp nanoseconds */
+	};
 };
 
 /*
@@ -904,9 +906,9 @@ typedef struct xfs_dinode {
 	__be16		di_projid_hi;	/* higher part owner's project id */
 	__u8		di_pad[6];	/* unused, zeroed space */
 	__be16		di_flushiter;	/* incremented on flush */
-	struct xfs_timestamp di_atime;	/* time last accessed */
-	struct xfs_timestamp di_mtime;	/* time last modified */
-	struct xfs_timestamp di_ctime;	/* time created/inode modified */
+	union xfs_timestamp di_atime;	/* time last accessed */
+	union xfs_timestamp di_mtime;	/* time last modified */
+	union xfs_timestamp di_ctime;	/* time created/inode modified */
 	__be64		di_size;	/* number of bytes in file */
 	__be64		di_nblocks;	/* # of direct & btree blocks used */
 	__be32		di_extsize;	/* basic/minimum extent size for file */
@@ -931,7 +933,7 @@ typedef struct xfs_dinode {
 	__u8		di_pad2[12];	/* more padding for future expansion */
 
 	/* fields only written to during inode creation */
-	struct xfs_timestamp di_crtime;	/* time created */
+	union xfs_timestamp di_crtime;	/* time created */
 	__be64		di_ino;		/* inode number */
 	uuid_t		di_uuid;	/* UUID of the filesystem */
 
diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
index 9f7309f9a576..a6c44ca6f2ad 100644
--- a/libxfs/xfs_inode_buf.c
+++ b/libxfs/xfs_inode_buf.c
@@ -161,7 +161,7 @@ xfs_imap_to_bp(
 void
 xfs_inode_from_disk_timestamp(
 	struct timespec64		*tv,
-	const struct xfs_timestamp	*ts)
+	const union xfs_timestamp	*ts)
 {
 	tv->tv_sec = (int)be32_to_cpu(ts->t_sec);
 	tv->tv_nsec = (int)be32_to_cpu(ts->t_nsec);
@@ -260,7 +260,7 @@ xfs_inode_from_disk(
 
 void
 xfs_inode_to_disk_timestamp(
-	struct xfs_timestamp		*ts,
+	union xfs_timestamp		*ts,
 	const struct timespec64		*tv)
 {
 	ts->t_sec = cpu_to_be32(tv->tv_sec);
diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h
index 9c63f3f932d7..f6160033fcbd 100644
--- a/libxfs/xfs_inode_buf.h
+++ b/libxfs/xfs_inode_buf.h
@@ -59,8 +59,8 @@ xfs_failaddr_t xfs_inode_validate_cowextsize(struct xfs_mount *mp,
 		uint64_t flags2);
 
 void xfs_inode_from_disk_timestamp(struct timespec64 *tv,
-		const struct xfs_timestamp *ts);
-void xfs_inode_to_disk_timestamp(struct xfs_timestamp *ts,
+		const union xfs_timestamp *ts);
+void xfs_inode_to_disk_timestamp(union xfs_timestamp *ts,
 		const struct timespec64 *tv);
 
 #endif	/* __XFS_INODE_BUF_H__ */
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index f2fac9bea66d..17c83d29998c 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -368,9 +368,11 @@ static inline int xfs_ilog_fdata(int w)
  * directly mirrors the xfs_dinode structure as it must contain all the same
  * information.
  */
-struct xfs_ictimestamp {
-	int32_t		t_sec;		/* timestamp seconds */
-	int32_t		t_nsec;		/* timestamp nanoseconds */
+union xfs_ictimestamp {
+	struct {
+		int32_t		t_sec;		/* timestamp seconds */
+		int32_t		t_nsec;		/* timestamp nanoseconds */
+	};
 };
 
 /*
@@ -390,9 +392,9 @@ struct xfs_log_dinode {
 	uint16_t	di_projid_hi;	/* higher part of owner's project id */
 	uint8_t		di_pad[6];	/* unused, zeroed space */
 	uint16_t	di_flushiter;	/* incremented on flush */
-	struct xfs_ictimestamp di_atime;	/* time last accessed */
-	struct xfs_ictimestamp di_mtime;	/* time last modified */
-	struct xfs_ictimestamp di_ctime;	/* time created/inode modified */
+	union xfs_ictimestamp di_atime;	/* time last accessed */
+	union xfs_ictimestamp di_mtime;	/* time last modified */
+	union xfs_ictimestamp di_ctime;	/* time created/inode modified */
 	xfs_fsize_t	di_size;	/* number of bytes in file */
 	xfs_rfsblock_t	di_nblocks;	/* # of direct & btree blocks used */
 	xfs_extlen_t	di_extsize;	/* basic/minimum extent size for file */
@@ -417,7 +419,7 @@ struct xfs_log_dinode {
 	uint8_t		di_pad2[12];	/* more padding for future expansion */
 
 	/* fields only written to during inode creation */
-	struct xfs_ictimestamp di_crtime;	/* time created */
+	union xfs_ictimestamp di_crtime;	/* time created */
 	xfs_ino_t	di_ino;		/* inode number */
 	uuid_t		di_uuid;	/* UUID of the filesystem */
 
diff --git a/repair/dinode.c b/repair/dinode.c
index 957a2698b09e..c5f2248b2b9a 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -2169,7 +2169,7 @@ static void
 check_nsec(
 	const char		*name,
 	xfs_ino_t		lino,
-	struct xfs_timestamp	*t,
+	union xfs_timestamp	*t,
 	int			*dirty)
 {
 	if (be32_to_cpu(t->t_nsec) < 1000000000)


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

* [PATCH 09/18] libxfs: refactor NSEC_PER_SEC
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (7 preceding siblings ...)
  2020-08-17 22:59 ` [PATCH 08/18] xfs: convert struct xfs_timestamp to union Darrick J. Wong
@ 2020-08-17 22:59 ` Darrick J. Wong
  2020-08-18 14:31   ` Amir Goldstein
  2020-08-17 22:59 ` [PATCH 10/18] xfs: widen ondisk timestamps to deal with y2038 problem Darrick J. Wong
                   ` (8 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 22:59 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Clean up all the open-coded and duplicate definitions of time unit
conversion factors.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 include/platform_defs.h.in |    3 +++
 repair/dinode.c            |    2 +-
 scrub/common.c             |    2 --
 scrub/progress.c           |    1 -
 4 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in
index 1f7ceafb1fbc..a11b58719380 100644
--- a/include/platform_defs.h.in
+++ b/include/platform_defs.h.in
@@ -80,4 +80,7 @@ typedef unsigned short umode_t;
 
 extern int	platform_nproc(void);
 
+#define NSEC_PER_SEC	(1000000000ULL)
+#define NSEC_PER_USEC	(1000ULL)
+
 #endif	/* __XFS_PLATFORM_DEFS_H__ */
diff --git a/repair/dinode.c b/repair/dinode.c
index c5f2248b2b9a..0bee3c3d988e 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -2172,7 +2172,7 @@ check_nsec(
 	union xfs_timestamp	*t,
 	int			*dirty)
 {
-	if (be32_to_cpu(t->t_nsec) < 1000000000)
+	if (be32_to_cpu(t->t_nsec) < NSEC_PER_SEC)
 		return;
 
 	do_warn(
diff --git a/scrub/common.c b/scrub/common.c
index 261f575a0c9b..70efaf04c648 100644
--- a/scrub/common.c
+++ b/scrub/common.c
@@ -294,8 +294,6 @@ scrub_nproc_workqueue(
  * Sleep for 100us * however many -b we got past the initial one.
  * This is an (albeit clumsy) way to throttle scrub activity.
  */
-#define NSEC_PER_SEC	1000000000ULL
-#define NSEC_PER_USEC	1000ULL
 void
 background_sleep(void)
 {
diff --git a/scrub/progress.c b/scrub/progress.c
index d8130ca5f93c..15247b7c6d1b 100644
--- a/scrub/progress.c
+++ b/scrub/progress.c
@@ -110,7 +110,6 @@ progress_report(
 	fflush(pt.fp);
 }
 
-#define NSEC_PER_SEC	(1000000000)
 static void *
 progress_report_thread(void *arg)
 {


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

* [PATCH 10/18] xfs: widen ondisk timestamps to deal with y2038 problem
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (8 preceding siblings ...)
  2020-08-17 22:59 ` [PATCH 09/18] libxfs: refactor NSEC_PER_SEC Darrick J. Wong
@ 2020-08-17 22:59 ` Darrick J. Wong
  2020-08-18 14:40   ` Amir Goldstein
  2020-08-17 23:00 ` [PATCH 11/18] xfs: refactor quota timestamp coding Darrick J. Wong
                   ` (7 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 22:59 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Redesign the ondisk timestamps to be a simple unsigned 64-bit counter of
nanoseconds since 14 Dec 1901 (i.e. the minimum time in the 32-bit unix
time epoch).  This enables us to handle dates up to 2486, which solves
the y2038 problem.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libfrog/fsgeom.c        |    6 +++--
 libxfs/util.c           |   10 ++++++---
 libxfs/xfs_format.h     |   38 ++++++++++++++++++++++++++++++++-
 libxfs/xfs_fs.h         |    1 +
 libxfs/xfs_inode_buf.c  |   54 ++++++++++++++++++++++++++++++++++++++++-------
 libxfs/xfs_inode_buf.h  |    8 +++----
 libxfs/xfs_log_format.h |    3 +++
 libxfs/xfs_sb.c         |    2 ++
 repair/dinode.c         |   12 ++++++----
 9 files changed, 111 insertions(+), 23 deletions(-)


diff --git a/libfrog/fsgeom.c b/libfrog/fsgeom.c
index bd93924ea795..14507668e41b 100644
--- a/libfrog/fsgeom.c
+++ b/libfrog/fsgeom.c
@@ -28,6 +28,7 @@ xfs_report_geom(
 	int			spinodes;
 	int			rmapbt_enabled;
 	int			reflink_enabled;
+	int			bigtime_enabled;
 
 	isint = geo->logstart > 0;
 	lazycount = geo->flags & XFS_FSOP_GEOM_FLAGS_LAZYSB ? 1 : 0;
@@ -43,12 +44,13 @@ xfs_report_geom(
 	spinodes = geo->flags & XFS_FSOP_GEOM_FLAGS_SPINODES ? 1 : 0;
 	rmapbt_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_RMAPBT ? 1 : 0;
 	reflink_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_REFLINK ? 1 : 0;
+	bigtime_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_BIGTIME ? 1 : 0;
 
 	printf(_(
 "meta-data=%-22s isize=%-6d agcount=%u, agsize=%u blks\n"
 "         =%-22s sectsz=%-5u attr=%u, projid32bit=%u\n"
 "         =%-22s crc=%-8u finobt=%u, sparse=%u, rmapbt=%u\n"
-"         =%-22s reflink=%u\n"
+"         =%-22s reflink=%-4u bigtime=%u\n"
 "data     =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
 "         =%-22s sunit=%-6u swidth=%u blks\n"
 "naming   =version %-14u bsize=%-6u ascii-ci=%d, ftype=%d\n"
@@ -58,7 +60,7 @@ xfs_report_geom(
 		mntpoint, geo->inodesize, geo->agcount, geo->agblocks,
 		"", geo->sectsize, attrversion, projid32bit,
 		"", crcs_enabled, finobt_enabled, spinodes, rmapbt_enabled,
-		"", reflink_enabled,
+		"", reflink_enabled, bigtime_enabled,
 		"", geo->blocksize, (unsigned long long)geo->datablocks,
 			geo->imaxpct,
 		"", geo->sunit, geo->swidth,
diff --git a/libxfs/util.c b/libxfs/util.c
index 6670fcdfa1d0..eceb6dc29a3b 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -197,7 +197,8 @@ xfs_flags2diflags2(
 	unsigned int		xflags)
 {
 	uint64_t		di_flags2 =
-		(ip->i_d.di_flags2 & XFS_DIFLAG2_REFLINK);
+		(ip->i_d.di_flags2 & (XFS_DIFLAG2_REFLINK |
+				      XFS_DIFLAG2_BIGTIME));
 
 	if (xflags & FS_XFLAG_DAX)
 		di_flags2 |= XFS_DIFLAG2_DAX;
@@ -279,8 +280,9 @@ libxfs_ialloc(
 		VFS_I(ip)->i_version = 1;
 		ip->i_d.di_flags2 = pip ? 0 : xfs_flags2diflags2(ip,
 				fsx->fsx_xflags);
-		ip->i_d.di_crtime.tv_sec = (int32_t)VFS_I(ip)->i_mtime.tv_sec;
-		ip->i_d.di_crtime.tv_nsec = (int32_t)VFS_I(ip)->i_mtime.tv_nsec;
+		if (xfs_sb_version_hasbigtime(&ip->i_mount->m_sb))
+			ip->i_d.di_flags2 |= XFS_DIFLAG2_BIGTIME;
+		ip->i_d.di_crtime = VFS_I(ip)->i_mtime;
 		ip->i_d.di_cowextsize = pip ? 0 : fsx->fsx_cowextsize;
 	}
 
@@ -375,6 +377,8 @@ libxfs_iflush_int(
 	}
 	ASSERT(ip->i_df.if_nextents+ip->i_afp->if_nextents <= ip->i_d.di_nblocks);
 	ASSERT(ip->i_d.di_forkoff <= mp->m_sb.sb_inodesize);
+	ASSERT(!(ip->i_d.di_flags2 & XFS_DIFLAG2_BIGTIME) &&
+	       xfs_sb_version_hasbigtime(&mp->m_sb));
 
 	/* bump the change count on v3 inodes */
 	if (xfs_sb_version_has_v3inode(&mp->m_sb))
diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
index 5403d3412cb6..67303e517260 100644
--- a/libxfs/xfs_format.h
+++ b/libxfs/xfs_format.h
@@ -467,6 +467,7 @@ xfs_sb_has_ro_compat_feature(
 #define XFS_SB_FEAT_INCOMPAT_FTYPE	(1 << 0)	/* filetype in dirent */
 #define XFS_SB_FEAT_INCOMPAT_SPINODES	(1 << 1)	/* sparse inode chunks */
 #define XFS_SB_FEAT_INCOMPAT_META_UUID	(1 << 2)	/* metadata UUID */
+#define XFS_SB_FEAT_INCOMPAT_BIGTIME	(1 << 3)	/* large timestamps */
 #define XFS_SB_FEAT_INCOMPAT_ALL \
 		(XFS_SB_FEAT_INCOMPAT_FTYPE|	\
 		 XFS_SB_FEAT_INCOMPAT_SPINODES|	\
@@ -565,6 +566,12 @@ static inline bool xfs_sb_version_hasreflink(struct xfs_sb *sbp)
 		(sbp->sb_features_ro_compat & XFS_SB_FEAT_RO_COMPAT_REFLINK);
 }
 
+static inline bool xfs_sb_version_hasbigtime(struct xfs_sb *sbp)
+{
+	return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 &&
+		(sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_BIGTIME);
+}
+
 /*
  * Inode btree block counter.  We record the number of inobt and finobt blocks
  * in the AGI header so that we can skip the finobt walk at mount time when
@@ -855,12 +862,18 @@ struct xfs_agfl {
  *
  * Inode timestamps consist of signed 32-bit counters for seconds and
  * nanoseconds; time zero is the Unix epoch, Jan  1 00:00:00 UTC 1970.
+ *
+ * When bigtime is enabled, timestamps become an unsigned 64-bit nanoseconds
+ * counter.  Time zero is the start of the classic timestamp range.
  */
 union xfs_timestamp {
 	struct {
 		__be32		t_sec;		/* timestamp seconds */
 		__be32		t_nsec;		/* timestamp nanoseconds */
 	};
+
+	/* Nanoseconds since the bigtime epoch. */
+	__be64			t_bigtime;
 };
 
 /*
@@ -875,6 +888,25 @@ union xfs_timestamp {
  */
 #define XFS_INO_TIME_MAX	((int64_t)S32_MAX)
 
+/*
+ * Number of seconds between the start of the bigtime timestamp range and the
+ * start of the Unix epoch.
+ */
+#define XFS_INO_BIGTIME_EPOCH	(-XFS_INO_TIME_MIN)
+
+/*
+ * Smallest possible timestamp with big timestamps, which is
+ * Dec 13 20:45:52 UTC 1901.
+ */
+#define XFS_INO_BIGTIME_MIN	(XFS_INO_TIME_MIN)
+
+/*
+ * Largest possible timestamp with big timestamps, which is
+ * Jul  2 20:20:25 UTC 2486.
+ */
+#define XFS_INO_BIGTIME_MAX	((int64_t)((-1ULL / NSEC_PER_SEC) - \
+					   XFS_INO_BIGTIME_EPOCH))
+
 /*
  * On-disk inode structure.
  *
@@ -1101,12 +1133,16 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
 #define XFS_DIFLAG2_DAX_BIT	0	/* use DAX for this inode */
 #define XFS_DIFLAG2_REFLINK_BIT	1	/* file's blocks may be shared */
 #define XFS_DIFLAG2_COWEXTSIZE_BIT   2  /* copy on write extent size hint */
+#define XFS_DIFLAG2_BIGTIME_BIT	3	/* big timestamps */
+
 #define XFS_DIFLAG2_DAX		(1 << XFS_DIFLAG2_DAX_BIT)
 #define XFS_DIFLAG2_REFLINK     (1 << XFS_DIFLAG2_REFLINK_BIT)
 #define XFS_DIFLAG2_COWEXTSIZE  (1 << XFS_DIFLAG2_COWEXTSIZE_BIT)
+#define XFS_DIFLAG2_BIGTIME	(1 << XFS_DIFLAG2_BIGTIME_BIT)
 
 #define XFS_DIFLAG2_ANY \
-	(XFS_DIFLAG2_DAX | XFS_DIFLAG2_REFLINK | XFS_DIFLAG2_COWEXTSIZE)
+	(XFS_DIFLAG2_DAX | XFS_DIFLAG2_REFLINK | XFS_DIFLAG2_COWEXTSIZE | \
+	 XFS_DIFLAG2_BIGTIME)
 
 /*
  * Inode number format:
diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
index dc2543dd5955..69f998666569 100644
--- a/libxfs/xfs_fs.h
+++ b/libxfs/xfs_fs.h
@@ -249,6 +249,7 @@ typedef struct xfs_fsop_resblks {
 #define XFS_FSOP_GEOM_FLAGS_SPINODES	(1 << 18) /* sparse inode chunks   */
 #define XFS_FSOP_GEOM_FLAGS_RMAPBT	(1 << 19) /* reverse mapping btree */
 #define XFS_FSOP_GEOM_FLAGS_REFLINK	(1 << 20) /* files can share blocks */
+#define XFS_FSOP_GEOM_FLAGS_BIGTIME	(1 << 21) /* 64-bit nsec timestamps */
 
 /*
  * Minimum and maximum sizes need for growth checks.
diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
index a6c44ca6f2ad..2fb668c07b70 100644
--- a/libxfs/xfs_inode_buf.c
+++ b/libxfs/xfs_inode_buf.c
@@ -158,11 +158,25 @@ xfs_imap_to_bp(
 	return 0;
 }
 
+/* Convert an ondisk timestamp into the 64-bit safe incore format. */
 void
 xfs_inode_from_disk_timestamp(
+	struct xfs_dinode		*dip,
 	struct timespec64		*tv,
 	const union xfs_timestamp	*ts)
 {
+	if (dip->di_version >= 3 &&
+	    (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_BIGTIME))) {
+		uint64_t		t = be64_to_cpu(ts->t_bigtime);
+		uint64_t		s;
+		uint32_t		n;
+
+		s = div_u64_rem(t, NSEC_PER_SEC, &n);
+		tv->tv_sec = s - XFS_INO_BIGTIME_EPOCH;
+		tv->tv_nsec = n;
+		return;
+	}
+
 	tv->tv_sec = (int)be32_to_cpu(ts->t_sec);
 	tv->tv_nsec = (int)be32_to_cpu(ts->t_nsec);
 }
@@ -221,9 +235,9 @@ xfs_inode_from_disk(
 	 * a time before epoch is converted to a time long after epoch
 	 * on 64 bit systems.
 	 */
-	xfs_inode_from_disk_timestamp(&inode->i_atime, &from->di_atime);
-	xfs_inode_from_disk_timestamp(&inode->i_mtime, &from->di_mtime);
-	xfs_inode_from_disk_timestamp(&inode->i_ctime, &from->di_ctime);
+	xfs_inode_from_disk_timestamp(from, &inode->i_atime, &from->di_atime);
+	xfs_inode_from_disk_timestamp(from, &inode->i_mtime, &from->di_mtime);
+	xfs_inode_from_disk_timestamp(from, &inode->i_ctime, &from->di_ctime);
 
 	to->di_size = be64_to_cpu(from->di_size);
 	to->di_nblocks = be64_to_cpu(from->di_nblocks);
@@ -236,9 +250,17 @@ xfs_inode_from_disk(
 	if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
 		inode_set_iversion_queried(inode,
 					   be64_to_cpu(from->di_changecount));
-		xfs_inode_from_disk_timestamp(&to->di_crtime, &from->di_crtime);
+		xfs_inode_from_disk_timestamp(from, &to->di_crtime,
+				&from->di_crtime);
 		to->di_flags2 = be64_to_cpu(from->di_flags2);
 		to->di_cowextsize = be32_to_cpu(from->di_cowextsize);
+		/*
+		 * Set the bigtime flag incore so that we automatically convert
+		 * this inode's ondisk timestamps to bigtime format the next
+		 * time we write the inode core to disk.
+		 */
+		if (xfs_sb_version_hasbigtime(&ip->i_mount->m_sb))
+			to->di_flags2 |= XFS_DIFLAG2_BIGTIME;
 	}
 
 	error = xfs_iformat_data_fork(ip, from);
@@ -260,9 +282,19 @@ xfs_inode_from_disk(
 
 void
 xfs_inode_to_disk_timestamp(
+	struct xfs_icdinode		*from,
 	union xfs_timestamp		*ts,
 	const struct timespec64		*tv)
 {
+	if (from->di_flags2 & XFS_DIFLAG2_BIGTIME) {
+		uint64_t		t;
+
+		t = (uint64_t)(tv->tv_sec + XFS_INO_BIGTIME_EPOCH);
+		t *= NSEC_PER_SEC;
+		ts->t_bigtime = cpu_to_be64(t + tv->tv_nsec);
+		return;
+	}
+
 	ts->t_sec = cpu_to_be32(tv->tv_sec);
 	ts->t_nsec = cpu_to_be32(tv->tv_nsec);
 }
@@ -286,9 +318,9 @@ xfs_inode_to_disk(
 	to->di_projid_hi = cpu_to_be16(from->di_projid >> 16);
 
 	memset(to->di_pad, 0, sizeof(to->di_pad));
-	xfs_inode_to_disk_timestamp(&to->di_atime, &inode->i_atime);
-	xfs_inode_to_disk_timestamp(&to->di_mtime, &inode->i_mtime);
-	xfs_inode_to_disk_timestamp(&to->di_ctime, &inode->i_ctime);
+	xfs_inode_to_disk_timestamp(from, &to->di_atime, &inode->i_atime);
+	xfs_inode_to_disk_timestamp(from, &to->di_mtime, &inode->i_mtime);
+	xfs_inode_to_disk_timestamp(from, &to->di_ctime, &inode->i_ctime);
 	to->di_nlink = cpu_to_be32(inode->i_nlink);
 	to->di_gen = cpu_to_be32(inode->i_generation);
 	to->di_mode = cpu_to_be16(inode->i_mode);
@@ -307,7 +339,8 @@ xfs_inode_to_disk(
 	if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
 		to->di_version = 3;
 		to->di_changecount = cpu_to_be64(inode_peek_iversion(inode));
-		xfs_inode_to_disk_timestamp(&to->di_crtime, &from->di_crtime);
+		xfs_inode_to_disk_timestamp(from, &to->di_crtime,
+				&from->di_crtime);
 		to->di_flags2 = cpu_to_be64(from->di_flags2);
 		to->di_cowextsize = cpu_to_be32(from->di_cowextsize);
 		to->di_ino = cpu_to_be64(ip->i_ino);
@@ -527,6 +560,11 @@ xfs_dinode_verify(
 	if (fa)
 		return fa;
 
+	/* bigtime iflag can only happen on bigtime filesystems */
+	if ((flags2 & (XFS_DIFLAG2_BIGTIME)) &&
+	    !xfs_sb_version_hasbigtime(&mp->m_sb))
+		return __this_address;
+
 	return NULL;
 }
 
diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h
index f6160033fcbd..3b25e43eafa1 100644
--- a/libxfs/xfs_inode_buf.h
+++ b/libxfs/xfs_inode_buf.h
@@ -58,9 +58,9 @@ xfs_failaddr_t xfs_inode_validate_cowextsize(struct xfs_mount *mp,
 		uint32_t cowextsize, uint16_t mode, uint16_t flags,
 		uint64_t flags2);
 
-void xfs_inode_from_disk_timestamp(struct timespec64 *tv,
-		const union xfs_timestamp *ts);
-void xfs_inode_to_disk_timestamp(union xfs_timestamp *ts,
-		const struct timespec64 *tv);
+void xfs_inode_from_disk_timestamp(struct xfs_dinode *dip,
+		struct timespec64 *tv, const union xfs_timestamp *ts);
+void xfs_inode_to_disk_timestamp(struct xfs_icdinode *from,
+		union xfs_timestamp *ts, const struct timespec64 *tv);
 
 #endif	/* __XFS_INODE_BUF_H__ */
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 17c83d29998c..569721f7f9e5 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -373,6 +373,9 @@ union xfs_ictimestamp {
 		int32_t		t_sec;		/* timestamp seconds */
 		int32_t		t_nsec;		/* timestamp nanoseconds */
 	};
+
+	/* Nanoseconds since the bigtime epoch. */
+	uint64_t		t_bigtime;
 };
 
 /*
diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
index 0eb16305e221..001b88865b0a 100644
--- a/libxfs/xfs_sb.c
+++ b/libxfs/xfs_sb.c
@@ -1143,6 +1143,8 @@ xfs_fs_geometry(
 		geo->flags |= XFS_FSOP_GEOM_FLAGS_RMAPBT;
 	if (xfs_sb_version_hasreflink(sbp))
 		geo->flags |= XFS_FSOP_GEOM_FLAGS_REFLINK;
+	if (xfs_sb_version_hasbigtime(sbp))
+		geo->flags |= XFS_FSOP_GEOM_FLAGS_BIGTIME;
 	if (xfs_sb_version_hassector(sbp))
 		geo->logsectsize = sbp->sb_logsectsize;
 	else
diff --git a/repair/dinode.c b/repair/dinode.c
index 0bee3c3d988e..ad2f672d8703 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -2169,10 +2169,12 @@ static void
 check_nsec(
 	const char		*name,
 	xfs_ino_t		lino,
+	struct xfs_dinode	*dip,
 	union xfs_timestamp	*t,
 	int			*dirty)
 {
-	if (be32_to_cpu(t->t_nsec) < NSEC_PER_SEC)
+	if ((dip->di_flags2 & be64_to_cpu(XFS_DIFLAG2_BIGTIME)) ||
+	    be32_to_cpu(t->t_nsec) < NSEC_PER_SEC)
 		return;
 
 	do_warn(
@@ -2726,11 +2728,11 @@ _("Bad CoW extent size %u on inode %" PRIu64 ", "),
 	}
 
 	/* nsec fields cannot be larger than 1 billion */
-	check_nsec("atime", lino, &dino->di_atime, dirty);
-	check_nsec("mtime", lino, &dino->di_mtime, dirty);
-	check_nsec("ctime", lino, &dino->di_ctime, dirty);
+	check_nsec("atime", lino, dino, &dino->di_atime, dirty);
+	check_nsec("mtime", lino, dino, &dino->di_mtime, dirty);
+	check_nsec("ctime", lino, dino, &dino->di_ctime, dirty);
 	if (dino->di_version >= 3)
-		check_nsec("crtime", lino, &dino->di_crtime, dirty);
+		check_nsec("crtime", lino, dino, &dino->di_crtime, dirty);
 
 	/*
 	 * general size/consistency checks:


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

* [PATCH 11/18] xfs: refactor quota timestamp coding
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (9 preceding siblings ...)
  2020-08-17 22:59 ` [PATCH 10/18] xfs: widen ondisk timestamps to deal with y2038 problem Darrick J. Wong
@ 2020-08-17 23:00 ` Darrick J. Wong
  2020-08-18 14:41   ` Amir Goldstein
  2020-08-17 23:00 ` [PATCH 12/18] xfs: enable bigtime for quota timers Darrick J. Wong
                   ` (6 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 23:00 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Refactor quota timestamp encoding and decoding into helper functions so
that we can add extra behavior in the next patch.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/xfs_dquot_buf.c  |   20 ++++++++++++++++++++
 libxfs/xfs_quota_defs.h |    6 ++++++
 2 files changed, 26 insertions(+)


diff --git a/libxfs/xfs_dquot_buf.c b/libxfs/xfs_dquot_buf.c
index b5adb840d015..847b9ba5280c 100644
--- a/libxfs/xfs_dquot_buf.c
+++ b/libxfs/xfs_dquot_buf.c
@@ -286,3 +286,23 @@ const struct xfs_buf_ops xfs_dquot_buf_ra_ops = {
 	.verify_read = xfs_dquot_buf_readahead_verify,
 	.verify_write = xfs_dquot_buf_write_verify,
 };
+
+/* Convert an on-disk timer value into an incore timer value. */
+void
+xfs_dquot_from_disk_timestamp(
+	struct xfs_disk_dquot	*ddq,
+	time64_t		*timer,
+	__be32			dtimer)
+{
+	*timer = be32_to_cpu(dtimer);
+}
+
+/* Convert an incore timer value into an on-disk timer value. */
+void
+xfs_dquot_to_disk_timestamp(
+	struct xfs_dquot	*dqp,
+	__be32			*dtimer,
+	time64_t		timer)
+{
+	*dtimer = cpu_to_be32(timer);
+}
diff --git a/libxfs/xfs_quota_defs.h b/libxfs/xfs_quota_defs.h
index 076bdc7037ee..b524059faab5 100644
--- a/libxfs/xfs_quota_defs.h
+++ b/libxfs/xfs_quota_defs.h
@@ -143,4 +143,10 @@ extern int xfs_calc_dquots_per_chunk(unsigned int nbblks);
 extern void xfs_dqblk_repair(struct xfs_mount *mp, struct xfs_dqblk *dqb,
 		xfs_dqid_t id, xfs_dqtype_t type);
 
+struct xfs_dquot;
+void xfs_dquot_from_disk_timestamp(struct xfs_disk_dquot *ddq,
+		time64_t *timer, __be32 dtimer);
+void xfs_dquot_to_disk_timestamp(struct xfs_dquot *ddq,
+		__be32 *dtimer, time64_t timer);
+
 #endif	/* __XFS_QUOTA_H__ */


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

* [PATCH 12/18] xfs: enable bigtime for quota timers
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (10 preceding siblings ...)
  2020-08-17 23:00 ` [PATCH 11/18] xfs: refactor quota timestamp coding Darrick J. Wong
@ 2020-08-17 23:00 ` Darrick J. Wong
  2020-08-17 23:00 ` [PATCH 13/18] xfs: enable big timestamps Darrick J. Wong
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 23:00 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Enable the bigtime feature for quota timers.  We decrease the accuracy
of the timers to ~4s in exchange for being able to set timers up to the
bigtime maximum.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 include/xfs_mount.h     |    5 +++++
 libxfs/xfs_dquot_buf.c  |   40 ++++++++++++++++++++++++++++++++++++++++
 libxfs/xfs_format.h     |   26 +++++++++++++++++++++++++-
 libxfs/xfs_quota_defs.h |    3 ++-
 4 files changed, 72 insertions(+), 2 deletions(-)


diff --git a/include/xfs_mount.h b/include/xfs_mount.h
index 20c8bfaf4fa8..be74a922b7a1 100644
--- a/include/xfs_mount.h
+++ b/include/xfs_mount.h
@@ -184,4 +184,9 @@ extern xfs_mount_t	*libxfs_mount (xfs_mount_t *, xfs_sb_t *,
 int		libxfs_umount(struct xfs_mount *mp);
 extern void	libxfs_rtmount_destroy (xfs_mount_t *);
 
+/* Dummy xfs_dquot so that libxfs compiles. */
+struct xfs_dquot {
+	int		q_type;
+};
+
 #endif	/* __XFS_MOUNT_H__ */
diff --git a/libxfs/xfs_dquot_buf.c b/libxfs/xfs_dquot_buf.c
index 847b9ba5280c..e5938ef649f0 100644
--- a/libxfs/xfs_dquot_buf.c
+++ b/libxfs/xfs_dquot_buf.c
@@ -67,6 +67,13 @@ xfs_dquot_verify(
 	    ddq_type != XFS_DQTYPE_GROUP)
 		return __this_address;
 
+	if ((ddq->d_type & XFS_DQTYPE_BIGTIME) &&
+	    !xfs_sb_version_hasbigtime(&mp->m_sb))
+		return __this_address;
+
+	if ((ddq->d_type & XFS_DQTYPE_BIGTIME) && !ddq->d_id)
+		return __this_address;
+
 	if (id != -1 && id != be32_to_cpu(ddq->d_id))
 		return __this_address;
 
@@ -294,6 +301,20 @@ xfs_dquot_from_disk_timestamp(
 	time64_t		*timer,
 	__be32			dtimer)
 {
+	/* Zero always means zero, regardless of encoding. */
+	if (!dtimer) {
+		*timer = 0;
+		return;
+	}
+
+	if (ddq->d_type & XFS_DQTYPE_BIGTIME) {
+		uint64_t	t;
+
+		t = be32_to_cpu(dtimer);
+		*timer = t << XFS_DQ_BIGTIME_SHIFT;
+		return;
+	}
+
 	*timer = be32_to_cpu(dtimer);
 }
 
@@ -304,5 +325,24 @@ xfs_dquot_to_disk_timestamp(
 	__be32			*dtimer,
 	time64_t		timer)
 {
+	/* Zero always means zero, regardless of encoding. */
+	if (!timer) {
+		*dtimer = cpu_to_be32(0);
+		return;
+	}
+
+	if (dqp->q_type & XFS_DQTYPE_BIGTIME) {
+		uint64_t	t = timer;
+
+		/*
+		 * Round the end of the grace period up to the nearest bigtime
+		 * interval that we support, to give users the most time to fix
+		 * the problems.
+		 */
+		t = roundup_64(t, 1U << XFS_DQ_BIGTIME_SHIFT);
+		*dtimer = cpu_to_be32(t >> XFS_DQ_BIGTIME_SHIFT);
+		return;
+	}
+
 	*dtimer = cpu_to_be32(timer);
 }
diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
index 67303e517260..87c86a6dfb91 100644
--- a/libxfs/xfs_format.h
+++ b/libxfs/xfs_format.h
@@ -1228,13 +1228,15 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
 #define XFS_DQTYPE_USER		0x01		/* user dquot record */
 #define XFS_DQTYPE_PROJ		0x02		/* project dquot record */
 #define XFS_DQTYPE_GROUP	0x04		/* group dquot record */
+#define XFS_DQTYPE_BIGTIME	0x08		/* large expiry timestamps */
 
 /* bitmask to determine if this is a user/group/project dquot */
 #define XFS_DQTYPE_REC_MASK	(XFS_DQTYPE_USER | \
 				 XFS_DQTYPE_PROJ | \
 				 XFS_DQTYPE_GROUP)
 
-#define XFS_DQTYPE_ANY		(XFS_DQTYPE_REC_MASK)
+#define XFS_DQTYPE_ANY		(XFS_DQTYPE_REC_MASK | \
+				 XFS_DQTYPE_BIGTIME)
 
 /*
  * XFS Quota Timers
@@ -1271,6 +1273,28 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
 #define XFS_DQ_GRACE_MIN	((int64_t)0)
 #define XFS_DQ_GRACE_MAX	((int64_t)U32_MAX)
 
+/*
+ * When bigtime is enabled, we trade a few bits of precision to expand the
+ * expiration timeout range to match that of big inode timestamps.  The grace
+ * periods stored in dquot 0 are not shifted, since they record an interval,
+ * not a timestamp.
+ */
+#define XFS_DQ_BIGTIME_SHIFT		(2)
+
+/*
+ * Smallest possible quota expiration with big timestamps, which is
+ * Jan  1 00:00:01 UTC 1970.
+ */
+#define XFS_DQ_BIGTIMEOUT_MIN		(XFS_DQ_TIMEOUT_MIN)
+
+/*
+ * Largest supported quota expiration with traditional timestamps, which is
+ * the largest bigtime inode timestamp, or Jul  2 20:20:25 UTC 2486.  The field
+ * is large enough that it's possible to fit expirations up to 2514, but we
+ * want to keep the maximum timestamp in sync.
+ */
+#define XFS_DQ_BIGTIMEOUT_MAX		(XFS_INO_BIGTIME_MAX)
+
 /*
  * This is the main portion of the on-disk representation of quota information
  * for a user.  We pad this with some more expansion room to construct the on
diff --git a/libxfs/xfs_quota_defs.h b/libxfs/xfs_quota_defs.h
index b524059faab5..b9a47eae684b 100644
--- a/libxfs/xfs_quota_defs.h
+++ b/libxfs/xfs_quota_defs.h
@@ -23,7 +23,8 @@ typedef uint8_t		xfs_dqtype_t;
 #define XFS_DQTYPE_STRINGS \
 	{ XFS_DQTYPE_USER,	"USER" }, \
 	{ XFS_DQTYPE_PROJ,	"PROJ" }, \
-	{ XFS_DQTYPE_GROUP,	"GROUP" }
+	{ XFS_DQTYPE_GROUP,	"GROUP" }, \
+	{ XFS_DQTYPE_BIGTIME,	"BIGTIME" }
 
 /*
  * flags for q_flags field in the dquot.


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

* [PATCH 13/18] xfs: enable big timestamps
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (11 preceding siblings ...)
  2020-08-17 23:00 ` [PATCH 12/18] xfs: enable bigtime for quota timers Darrick J. Wong
@ 2020-08-17 23:00 ` Darrick J. Wong
  2020-08-18 14:42   ` Amir Goldstein
  2020-08-17 23:00 ` [PATCH 14/18] xfs_db: report bigtime format timestamps Darrick J. Wong
                   ` (4 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 23:00 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Enable the big timestamp feature.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/xfs_format.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
index 87c86a6dfb91..9e90270452b9 100644
--- a/libxfs/xfs_format.h
+++ b/libxfs/xfs_format.h
@@ -471,7 +471,8 @@ xfs_sb_has_ro_compat_feature(
 #define XFS_SB_FEAT_INCOMPAT_ALL \
 		(XFS_SB_FEAT_INCOMPAT_FTYPE|	\
 		 XFS_SB_FEAT_INCOMPAT_SPINODES|	\
-		 XFS_SB_FEAT_INCOMPAT_META_UUID)
+		 XFS_SB_FEAT_INCOMPAT_META_UUID| \
+		 XFS_SB_FEAT_INCOMPAT_BIGTIME)
 
 #define XFS_SB_FEAT_INCOMPAT_UNKNOWN	~XFS_SB_FEAT_INCOMPAT_ALL
 static inline bool


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

* [PATCH 14/18] xfs_db: report bigtime format timestamps
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (12 preceding siblings ...)
  2020-08-17 23:00 ` [PATCH 13/18] xfs: enable big timestamps Darrick J. Wong
@ 2020-08-17 23:00 ` Darrick J. Wong
  2020-08-18 15:37   ` Darrick J. Wong
  2020-08-17 23:00 ` [PATCH 15/18] xfs_db: support printing time limits Darrick J. Wong
                   ` (3 subsequent siblings)
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 23:00 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Report the large format timestamps.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 db/dquot.c               |   31 +++++++++++-
 db/field.c               |    6 ++
 db/field.h               |    3 +
 db/fprint.c              |  120 ++++++++++++++++++++++++++++++++++++++++++++++
 db/fprint.h              |    6 ++
 db/inode.c               |   28 ++++++++++-
 db/sb.c                  |    2 +
 libxfs/libxfs_api_defs.h |    3 +
 8 files changed, 194 insertions(+), 5 deletions(-)


diff --git a/db/dquot.c b/db/dquot.c
index edfcb0ca0744..30f4e6523c39 100644
--- a/db/dquot.c
+++ b/db/dquot.c
@@ -44,6 +44,22 @@ const field_t	dqblk_flds[] = {
 	{ NULL }
 };
 
+static int
+dquot_timestamp_count(
+	void		*obj,
+	int		startoff)
+{
+	return xfs_sb_version_hasbigtime(&mp->m_sb) ? 0 : 1;
+}
+
+static int
+dquot_bigtimestamp_count(
+	void		*obj,
+	int		startoff)
+{
+	return xfs_sb_version_hasbigtime(&mp->m_sb) ? 1 : 0;
+}
+
 #define	DOFF(f)		bitize(offsetof(struct xfs_disk_dquot, d_ ## f))
 const field_t	disk_dquot_flds[] = {
 	{ "magic", FLDT_UINT16X, OI(DOFF(magic)), C1, 0, TYP_NONE },
@@ -60,8 +76,14 @@ const field_t	disk_dquot_flds[] = {
 	  TYP_NONE },
 	{ "bcount", FLDT_QCNT, OI(DOFF(bcount)), C1, 0, TYP_NONE },
 	{ "icount", FLDT_QCNT, OI(DOFF(icount)), C1, 0, TYP_NONE },
-	{ "itimer", FLDT_INT32D, OI(DOFF(itimer)), C1, 0, TYP_NONE },
-	{ "btimer", FLDT_INT32D, OI(DOFF(btimer)), C1, 0, TYP_NONE },
+	{ "itimer", FLDT_INT32D, OI(DOFF(itimer)), dquot_timestamp_count,
+	  FLD_COUNT, TYP_NONE },
+	{ "btimer", FLDT_INT32D, OI(DOFF(btimer)), dquot_timestamp_count,
+	  FLD_COUNT, TYP_NONE },
+	{ "itimer", FLDT_BTQTIMER, OI(DOFF(itimer)), dquot_bigtimestamp_count,
+	  FLD_COUNT, TYP_NONE },
+	{ "btimer", FLDT_BTQTIMER, OI(DOFF(btimer)), dquot_bigtimestamp_count,
+	  FLD_COUNT, TYP_NONE },
 	{ "iwarns", FLDT_QWARNCNT, OI(DOFF(iwarns)), C1, 0, TYP_NONE },
 	{ "bwarns", FLDT_QWARNCNT, OI(DOFF(bwarns)), C1, 0, TYP_NONE },
 	{ "pad0", FLDT_UINT32X, OI(DOFF(pad0)), C1, FLD_SKIPALL, TYP_NONE },
@@ -70,7 +92,10 @@ const field_t	disk_dquot_flds[] = {
 	{ "rtb_softlimit", FLDT_QCNT, OI(DOFF(rtb_softlimit)), C1, 0,
 	  TYP_NONE },
 	{ "rtbcount", FLDT_QCNT, OI(DOFF(rtbcount)), C1, 0, TYP_NONE },
-	{ "rtbtimer", FLDT_INT32D, OI(DOFF(rtbtimer)), C1, 0, TYP_NONE },
+	{ "rtbtimer", FLDT_INT32D, OI(DOFF(rtbtimer)), dquot_timestamp_count,
+	  FLD_COUNT, TYP_NONE },
+	{ "rtbtimer", FLDT_BTQTIMER, OI(DOFF(rtbtimer)),
+	  dquot_bigtimestamp_count, FLD_COUNT, TYP_NONE },
 	{ "rtbwarns", FLDT_QWARNCNT, OI(DOFF(rtbwarns)), C1, 0, TYP_NONE },
 	{ "pad", FLDT_UINT16X, OI(DOFF(pad)), C1, FLD_SKIPALL, TYP_NONE },
 	{ NULL }
diff --git a/db/field.c b/db/field.c
index cf3002c730e6..fad17b1f082e 100644
--- a/db/field.c
+++ b/db/field.c
@@ -351,6 +351,12 @@ const ftattr_t	ftattrtab[] = {
 	  NULL, NULL },
 	{ FLDT_TIMESTAMP, "timestamp", NULL, (char *)timestamp_flds,
 	  SI(bitsz(union xfs_timestamp)), 0, NULL, timestamp_flds },
+	{ FLDT_BTSEC, "btsec", fp_btsec, NULL, SI(bitsz(uint64_t)), 0, NULL,
+	  NULL },
+	{ FLDT_BTNSEC, "btnsec", fp_btnsec, NULL, SI(bitsz(uint64_t)), 0, NULL,
+	  NULL },
+	{ FLDT_BTQTIMER, "btqtimer", fp_btqtimer, NULL, SI(bitsz(uint32_t)), 0,
+	  NULL, NULL },
 	{ FLDT_UINT1, "uint1", fp_num, "%u", SI(1), 0, NULL, NULL },
 	{ FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(uint16_t)), 0, NULL,
 	  NULL },
diff --git a/db/field.h b/db/field.h
index 15065373de39..0d27cd085b13 100644
--- a/db/field.h
+++ b/db/field.h
@@ -170,6 +170,9 @@ typedef enum fldt	{
 
 	FLDT_TIME,
 	FLDT_TIMESTAMP,
+	FLDT_BTSEC,
+	FLDT_BTNSEC,
+	FLDT_BTQTIMER,
 	FLDT_UINT1,
 	FLDT_UINT16D,
 	FLDT_UINT16O,
diff --git a/db/fprint.c b/db/fprint.c
index c9d07e1bca7e..3a4f839b355d 100644
--- a/db/fprint.c
+++ b/db/fprint.c
@@ -19,6 +19,7 @@
 #include "sig.h"
 #include "malloc.h"
 #include "io.h"
+#include "init.h"
 
 int
 fp_charns(
@@ -145,6 +146,125 @@ fp_time(
 	return 1;
 }
 
+static void
+fp_timespec64(
+	struct timespec64	*ts)
+{
+	BUILD_BUG_ON(sizeof(long) != sizeof(time_t));
+
+	if (ts->tv_sec > LONG_MAX || ts->tv_sec < LONG_MIN) {
+		dbprintf("%lld", (long long)ts->tv_sec);
+	} else {
+		time_t	tt = ts->tv_sec;
+		char	*c;
+
+		c = ctime(&tt);
+		dbprintf("%24.24s", c);
+	}
+}
+
+int
+fp_btsec(
+	void			*obj,
+	int			bit,
+	int			count,
+	char			*fmtstr,
+	int			size,
+	int			arg,
+	int			base,
+	int			array)
+{
+	struct timespec64	ts;
+	union xfs_timestamp	*xts;
+	int			bitpos;
+	int			i;
+
+	ASSERT(bitoffs(bit) == 0);
+	for (i = 0, bitpos = bit;
+	     i < count && !seenint();
+	     i++, bitpos += size) {
+		if (array)
+			dbprintf("%d:", i + base);
+		xts = obj + byteize(bitpos);
+		libxfs_inode_from_disk_timestamp(obj, &ts, xts);
+		fp_timespec64(&ts);
+		if (i < count - 1)
+			dbprintf(" ");
+	}
+	return 1;
+}
+
+int
+fp_btnsec(
+	void			*obj,
+	int			bit,
+	int			count,
+	char			*fmtstr,
+	int			size,
+	int			arg,
+	int			base,
+	int			array)
+{
+	struct timespec64	ts;
+	union xfs_timestamp	*xts;
+	int			bitpos;
+	int			i;
+
+	ASSERT(bitoffs(bit) == 0);
+	for (i = 0, bitpos = bit;
+	     i < count && !seenint();
+	     i++, bitpos += size) {
+		if (array)
+			dbprintf("%d:", i + base);
+		xts = obj + byteize(bitpos);
+		libxfs_inode_from_disk_timestamp(obj, &ts, xts);
+		dbprintf("%u", ts.tv_nsec);
+		if (i < count - 1)
+			dbprintf(" ");
+	}
+	return 1;
+}
+
+int
+fp_btqtimer(
+	void			*obj,
+	int			bit,
+	int			count,
+	char			*fmtstr,
+	int			size,
+	int			arg,
+	int			base,
+	int			array)
+{
+	struct timespec64	ts = { 0 };
+	struct xfs_disk_dquot	*ddq = obj;
+	__be32			*t;
+	int			bitpos;
+	int			i;
+
+	ASSERT(bitoffs(bit) == 0);
+	for (i = 0, bitpos = bit;
+	     i < count && !seenint();
+	     i++, bitpos += size) {
+		if (array)
+			dbprintf("%d:", i + base);
+		t = obj + byteize(bitpos);
+		libxfs_dquot_from_disk_timestamp(ddq, &ts.tv_sec, *t);
+
+		/*
+		 * Display the raw value if it's the default grace expiration
+		 * period (root dquot) or if the quota has not expired.
+		 */
+		if (ddq->d_id == 0 || ts.tv_sec == 0)
+			dbprintf("%llu", (unsigned long long)ts.tv_sec);
+		else
+			fp_timespec64(&ts);
+		if (i < count - 1)
+			dbprintf(" ");
+	}
+	return 1;
+}
+
 /*ARGSUSED*/
 int
 fp_uuid(
diff --git a/db/fprint.h b/db/fprint.h
index c958dca0ed92..a33dcd11248d 100644
--- a/db/fprint.h
+++ b/db/fprint.h
@@ -15,6 +15,12 @@ extern int	fp_sarray(void *obj, int bit, int count, char *fmtstr, int size,
 			  int arg, int base, int array);
 extern int	fp_time(void *obj, int bit, int count, char *fmtstr, int size,
 			int arg, int base, int array);
+extern int	fp_btsec(void *obj, int bit, int count, char *fmtstr, int size,
+			int arg, int base, int array);
+extern int	fp_btnsec(void *obj, int bit, int count, char *fmtstr, int size,
+			int arg, int base, int array);
+extern int	fp_btqtimer(void *obj, int bit, int count, char *fmtstr,
+			int size, int arg, int base, int array);
 extern int	fp_uuid(void *obj, int bit, int count, char *fmtstr, int size,
 			int arg, int base, int array);
 extern int	fp_crc(void *obj, int bit, int count, char *fmtstr, int size,
diff --git a/db/inode.c b/db/inode.c
index 25112bb5e4d8..5fbfd4ddb5f5 100644
--- a/db/inode.c
+++ b/db/inode.c
@@ -175,14 +175,38 @@ const field_t	inode_v3_flds[] = {
 	{ "dax", FLDT_UINT1,
 	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_DAX_BIT - 1), C1,
 	  0, TYP_NONE },
+	{ "bigtime", FLDT_UINT1,
+	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_BIGTIME_BIT - 1), C1,
+	  0, TYP_NONE },
 	{ NULL }
 };
 
+static int
+inode_timestamp_count(
+	void		*obj,
+	int		startoff)
+{
+	return xfs_sb_version_hasbigtime(&mp->m_sb) ? 0 : 1;
+}
+
+static int
+inode_bigtimestamp_count(
+	void		*obj,
+	int		startoff)
+{
+	return xfs_sb_version_hasbigtime(&mp->m_sb) ? 1 : 0;
+}
 
 #define	TOFF(f)	bitize(offsetof(union xfs_timestamp, t_ ## f))
 const field_t	timestamp_flds[] = {
-	{ "sec", FLDT_TIME, OI(TOFF(sec)), C1, 0, TYP_NONE },
-	{ "nsec", FLDT_NSEC, OI(TOFF(nsec)), C1, 0, TYP_NONE },
+	{ "sec", FLDT_TIME, OI(TOFF(sec)), inode_timestamp_count, FLD_COUNT,
+		TYP_NONE },
+	{ "nsec", FLDT_NSEC, OI(TOFF(nsec)), inode_timestamp_count, FLD_COUNT,
+		TYP_NONE },
+	{ "sec", FLDT_BTSEC, OI(TOFF(bigtime)), inode_bigtimestamp_count,
+		FLD_COUNT, TYP_NONE },
+	{ "nsec", FLDT_BTNSEC, OI(TOFF(bigtime)), inode_bigtimestamp_count,
+		FLD_COUNT, TYP_NONE },
 	{ NULL }
 };
 
diff --git a/db/sb.c b/db/sb.c
index 33d9f7df49bb..c68bb9a958e7 100644
--- a/db/sb.c
+++ b/db/sb.c
@@ -727,6 +727,8 @@ version_string(
 		strcat(s, ",REFLINK");
 	if (xfs_sb_version_hasinobtcounts(sbp))
 		strcat(s, ",INOBTCNT");
+	if (xfs_sb_version_hasbigtime(sbp))
+		strcat(s, ",BIGTIME");
 	return s;
 }
 
diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h
index 4ee02473df0d..b83dc48a4802 100644
--- a/libxfs/libxfs_api_defs.h
+++ b/libxfs/libxfs_api_defs.h
@@ -116,6 +116,7 @@ struct timespec64 {
 #define xfs_dir_replace			libxfs_dir_replace
 
 #define xfs_dqblk_repair		libxfs_dqblk_repair
+#define xfs_dquot_from_disk_timestamp	libxfs_dquot_from_disk_timestamp
 #define xfs_dquot_verify		libxfs_dquot_verify
 
 #define xfs_finobt_calc_reserves	libxfs_finobt_calc_reserves
@@ -137,7 +138,9 @@ struct timespec64 {
 #define xfs_inobt_maxrecs		libxfs_inobt_maxrecs
 #define xfs_inobt_stage_cursor		libxfs_inobt_stage_cursor
 #define xfs_inode_from_disk		libxfs_inode_from_disk
+#define xfs_inode_from_disk_timestamp	libxfs_inode_from_disk_timestamp
 #define xfs_inode_to_disk		libxfs_inode_to_disk
+#define xfs_inode_to_disk_timestamp	libxfs_inode_to_disk_timestamp
 #define xfs_inode_validate_cowextsize	libxfs_inode_validate_cowextsize
 #define xfs_inode_validate_extsize	libxfs_inode_validate_extsize
 


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

* [PATCH 15/18] xfs_db: support printing time limits
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (13 preceding siblings ...)
  2020-08-17 23:00 ` [PATCH 14/18] xfs_db: report bigtime format timestamps Darrick J. Wong
@ 2020-08-17 23:00 ` Darrick J. Wong
  2020-08-17 23:00 ` [PATCH 16/18] xfs_db: add bigtime upgrade path Darrick J. Wong
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 23:00 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Support printing the minimum and maxium timestamp limits on this
filesystem.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 db/Makefile       |    2 -
 db/command.c      |    1 
 db/command.h      |    1 
 db/timelimit.c    |  152 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 man/man8/xfs_db.8 |   23 ++++++++
 5 files changed, 178 insertions(+), 1 deletion(-)
 create mode 100644 db/timelimit.c


diff --git a/db/Makefile b/db/Makefile
index 9bd9bf514f5d..9d502bf0d0d6 100644
--- a/db/Makefile
+++ b/db/Makefile
@@ -14,7 +14,7 @@ HFILES = addr.h agf.h agfl.h agi.h attr.h attrshort.h bit.h block.h bmap.h \
 	io.h logformat.h malloc.h metadump.h output.h print.h quit.h sb.h \
 	sig.h strvec.h text.h type.h write.h attrset.h symlink.h fsmap.h \
 	fuzz.h
-CFILES = $(HFILES:.h=.c) btdump.c btheight.c convert.c info.c
+CFILES = $(HFILES:.h=.c) btdump.c btheight.c convert.c info.c timelimit.c
 LSRCFILES = xfs_admin.sh xfs_ncheck.sh xfs_metadump.sh
 
 LLDLIBS	= $(LIBXFS) $(LIBXLOG) $(LIBFROG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD)
diff --git a/db/command.c b/db/command.c
index 0fb44efaec59..438283699b2e 100644
--- a/db/command.c
+++ b/db/command.c
@@ -139,4 +139,5 @@ init_commands(void)
 	write_init();
 	dquot_init();
 	fuzz_init();
+	timelimit_init();
 }
diff --git a/db/command.h b/db/command.h
index b8499de0be17..6913c8171fe1 100644
--- a/db/command.h
+++ b/db/command.h
@@ -32,3 +32,4 @@ extern void		convert_init(void);
 extern void		btdump_init(void);
 extern void		info_init(void);
 extern void		btheight_init(void);
+extern void		timelimit_init(void);
diff --git a/db/timelimit.c b/db/timelimit.c
new file mode 100644
index 000000000000..3cb24f563e3a
--- /dev/null
+++ b/db/timelimit.c
@@ -0,0 +1,152 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2020 Oracle.  All Rights Reserved.
+ * Author: Darrick J. Wong <darrick.wong@oracle.com>
+ */
+#include "libxfs.h"
+#include "command.h"
+#include "output.h"
+#include "init.h"
+
+enum show_what {
+	SHOW_AUTO,
+	SHOW_CLASSIC,
+	SHOW_BIGTIME,
+};
+
+
+enum print_how {
+	PRINT_RAW,
+	PRINT_PRETTY,
+	PRINT_COMPACT,
+};
+
+static void
+show_limit(
+	const char	*tag,
+	int64_t		limit,
+	int		how)
+{
+	time_t		tt = limit;
+	char		*c;
+
+	if (how == PRINT_COMPACT) {
+		dbprintf("%" PRId64 " ", limit);
+		return;
+	}
+
+	if (how == PRINT_RAW || limit > LONG_MAX) {
+		dbprintf("%s = %" PRId64 "\n", tag, limit);
+		return;
+	}
+
+	c = ctime(&tt);
+	dbprintf("%s = %24.24s\n", tag, c);
+}
+
+static void
+show_limits(
+	int	whatkind,
+	int	how)
+{
+	int	grace_how = how;
+
+	switch (whatkind) {
+	case SHOW_AUTO:
+		/* should never get here */
+		break;
+	case SHOW_CLASSIC:
+		show_limit("time.min", XFS_INO_TIME_MIN, how);
+		show_limit("time.max", XFS_INO_TIME_MAX, how);
+		show_limit("dqtimer.min", XFS_DQ_TIMEOUT_MIN, how);
+		show_limit("dqtimer.max", XFS_DQ_TIMEOUT_MAX, how);
+		break;
+	case SHOW_BIGTIME:
+		show_limit("time.min", XFS_INO_BIGTIME_MIN, how);
+		show_limit("time.max", XFS_INO_BIGTIME_MAX, how);
+		show_limit("dqtimer.min", XFS_DQ_BIGTIMEOUT_MIN, how);
+		show_limit("dqtimer.max", XFS_DQ_BIGTIMEOUT_MAX, how);
+		break;
+	}
+
+	/* grace periods are always integers */
+	if (grace_how != PRINT_COMPACT)
+		grace_how = PRINT_RAW;
+	show_limit("dqgrace.min", XFS_DQ_GRACE_MIN, grace_how);
+	show_limit("dqgrace.min", XFS_DQ_GRACE_MAX, grace_how);
+
+	if (how == PRINT_COMPACT)
+		dbprintf("\n");
+}
+
+static int
+timelimit_f(
+	int	argc,
+	char	**argv)
+{
+	int	whatkind = SHOW_AUTO;
+	int	how = PRINT_RAW;
+	int	i;
+
+	for (i = 1; i < argc; i++) {
+		if (!strcmp("--classic", argv[i]))
+			whatkind = SHOW_CLASSIC;
+		else if (!strcmp("--bigtime", argv[i]))
+			whatkind = SHOW_BIGTIME;
+		else if (!strcmp("--pretty", argv[i]))
+			how = PRINT_PRETTY;
+		else if (!strcmp("--compact", argv[i]))
+			how = PRINT_COMPACT;
+		else {
+			dbprintf(_("%s: bad option for timelimit command\n"),
+					argv[i]);
+			return 1;
+		}
+	}
+
+	if (whatkind == SHOW_AUTO) {
+		if (xfs_sb_version_hasbigtime(&mp->m_sb))
+			whatkind = SHOW_BIGTIME;
+		else
+			whatkind = SHOW_CLASSIC;
+	}
+
+	show_limits(whatkind, how);
+	return 0;
+}
+
+static void
+timelimit_help(void)
+{
+	dbprintf(_(
+"\n"
+" Print the minimum and maximum supported values for inode timestamps,\n"
+" disk quota expiration timers, and disk quota grace periods supported\n"
+" by this filesystem.\n"
+"\n"
+" Options:\n"
+"   --classic -- Force printing of the classic time limits.\n"
+"   --bigtime -- Force printing of the bigtime limits.\n"
+"   --pretty  -- Pretty-print the time limits.\n"
+"   --compact -- Print the limits in a single line.\n"
+"\n"
+));
+
+}
+
+static const cmdinfo_t	timelimit_cmd = {
+	.name		= "timelimit",
+	.cfunc		= timelimit_f,
+	.argmin		= 0,
+	.argmax		= -1,
+	.canpush	= 0,
+	.args		= N_("[--classic|--bigtime] [--pretty]"),
+	.oneline	= N_("display timestamp limits"),
+	.help		= timelimit_help,
+};
+
+void
+timelimit_init(void)
+{
+	add_command(&timelimit_cmd);
+}
diff --git a/man/man8/xfs_db.8 b/man/man8/xfs_db.8
index 7f73d458cf76..55388be68b93 100644
--- a/man/man8/xfs_db.8
+++ b/man/man8/xfs_db.8
@@ -887,6 +887,29 @@ The possible data types are:
 .BR rtsummary ", " sb ", " symlink " and " text .
 See the TYPES section below for more information on these data types.
 .TP
+.BI "timelimit [" OPTIONS ]
+Print the minimum and maximum supported values for inode timestamps,
+quota expiration timers, and quota grace periods supported by this
+filesystem.
+Options include:
+.RS 1.0i
+.TP 0.4i
+.B \--bigtime
+Print the time limits of an XFS filesystem with the
+.B bigtime
+feature enabled.
+.TP 0.4i
+.B \--classic
+Print the time limits of a classic XFS filesystem.
+.TP 0.4i
+.B \--compact
+Print all limits as raw values on a single line.
+.TP 0.4i
+.B \--pretty
+Print the timestamps in the current locale's date and time format instead of
+raw seconds since the Unix epoch.
+.RE
+.TP
 .BI "uuid [" uuid " | " generate " | " rewrite " | " restore ]
 Set the filesystem universally unique identifier (UUID).
 The filesystem UUID can be used by


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

* [PATCH 16/18] xfs_db: add bigtime upgrade path
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (14 preceding siblings ...)
  2020-08-17 23:00 ` [PATCH 15/18] xfs_db: support printing time limits Darrick J. Wong
@ 2020-08-17 23:00 ` Darrick J. Wong
  2020-08-18 15:17   ` Amir Goldstein
  2020-08-17 23:00 ` [PATCH 17/18] xfs_repair: support bigtime Darrick J. Wong
  2020-08-17 23:00 ` [PATCH 18/18] mkfs: format bigtime filesystems Darrick J. Wong
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 23:00 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Enable users to upgrade their filesystems to bigtime support.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 db/sb.c              |   13 +++++++++++++
 man/man8/xfs_admin.8 |    5 +++++
 2 files changed, 18 insertions(+)


diff --git a/db/sb.c b/db/sb.c
index c68bb9a958e7..4fb66dade2c2 100644
--- a/db/sb.c
+++ b/db/sb.c
@@ -778,6 +778,19 @@ version_f(
 			}
 
 			upgrade_ro_compat |= XFS_SB_FEAT_RO_COMPAT_INOBTCNT;
+		} else if (!strcasecmp(argv[1], "bigtime")) {
+			if (xfs_sb_version_hasbigtime(&mp->m_sb)) {
+				dbprintf(
+		_("bigtime feature is already enabled\n"));
+				return 0;
+			}
+			if (!xfs_sb_version_hascrc(&mp->m_sb)) {
+				dbprintf(
+		_("bigtime feature cannot be enabled on pre-V5 filesystems\n"));
+				return 0;
+			}
+
+			upgrade_incompat |= XFS_SB_FEAT_INCOMPAT_BIGTIME;
 		} else if (!strcasecmp(argv[1], "extflg")) {
 			switch (XFS_SB_VERSION_NUM(&mp->m_sb)) {
 			case XFS_SB_VERSION_1:
diff --git a/man/man8/xfs_admin.8 b/man/man8/xfs_admin.8
index 65ca6afc1e12..c09fe62b6827 100644
--- a/man/man8/xfs_admin.8
+++ b/man/man8/xfs_admin.8
@@ -117,6 +117,11 @@ This reduces mount time by caching the size of the inode btrees in the
 allocation group metadata.
 Once enabled, the filesystem will not be writable by older kernels.
 The filesystem cannot be downgraded after this feature is enabled.
+.TP
+.B bigtime
+Upgrade the filesystem to support larger timestamps up to the year 2486.
+Once enabled, the filesystem will not be readable by older kernels.
+The filesystem cannot be downgraded.
 .RE
 .TP
 .BI \-U " uuid"


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

* [PATCH 17/18] xfs_repair: support bigtime
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (15 preceding siblings ...)
  2020-08-17 23:00 ` [PATCH 16/18] xfs_db: add bigtime upgrade path Darrick J. Wong
@ 2020-08-17 23:00 ` Darrick J. Wong
  2020-08-18 14:58   ` Amir Goldstein
  2020-08-17 23:00 ` [PATCH 18/18] mkfs: format bigtime filesystems Darrick J. Wong
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 23:00 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Check the bigtime iflag in relation to the fs feature set.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 repair/dinode.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)


diff --git a/repair/dinode.c b/repair/dinode.c
index ad2f672d8703..3507cd06075d 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -2173,7 +2173,8 @@ check_nsec(
 	union xfs_timestamp	*t,
 	int			*dirty)
 {
-	if ((dip->di_flags2 & be64_to_cpu(XFS_DIFLAG2_BIGTIME)) ||
+	if ((dip->di_version >= 3 &&
+	     (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_BIGTIME))) ||
 	    be32_to_cpu(t->t_nsec) < NSEC_PER_SEC)
 		return;
 
@@ -2601,6 +2602,16 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
 			flags2 &= ~XFS_DIFLAG2_COWEXTSIZE;
 		}
 
+		if ((flags2 & XFS_DIFLAG2_BIGTIME) &&
+		    !xfs_sb_version_hasbigtime(&mp->m_sb)) {
+			if (!uncertain) {
+				do_warn(
+	_("inode %" PRIu64 " is marked bigtime but file system does not support large timestamps\n"),
+					lino);
+			}
+			flags2 &= ~XFS_DIFLAG2_BIGTIME;
+		}
+
 		if (!verify_mode && flags2 != be64_to_cpu(dino->di_flags2)) {
 			if (!no_modify) {
 				do_warn(_("fixing bad flags2.\n"));


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

* [PATCH 18/18] mkfs: format bigtime filesystems
  2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
                   ` (16 preceding siblings ...)
  2020-08-17 23:00 ` [PATCH 17/18] xfs_repair: support bigtime Darrick J. Wong
@ 2020-08-17 23:00 ` Darrick J. Wong
  2020-08-18 14:45   ` Amir Goldstein
  17 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-17 23:00 UTC (permalink / raw)
  To: sandeen, darrick.wong; +Cc: linux-xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Allow formatting with large timestamps.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 man/man8/mkfs.xfs.8 |   16 ++++++++++++++++
 mkfs/xfs_mkfs.c     |   24 +++++++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)


diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8
index 082f3ab6c063..7434b9f2b4cd 100644
--- a/man/man8/mkfs.xfs.8
+++ b/man/man8/mkfs.xfs.8
@@ -154,6 +154,22 @@ valid
 are:
 .RS 1.2i
 .TP
+.BI bigtime= value
+This option enables filesystems that can handle inode timestamps from December
+1901 to July 2486, and quota timer expirations from January 1970 to July 2486.
+The value is either 0 to disable the feature, or 1 to enable large timestamps.
+.IP
+If this feature is not enabled, the filesystem can only handle timestamps from
+December 1901 to January 2038, and quota timers from January 1970 to February
+2106.
+.IP
+By default,
+.B mkfs.xfs
+will not enable this feature.
+If the option
+.B \-m crc=0
+is used, the large timestamp feature is not supported and is disabled.
+.TP
 .BI crc= value
 This is used to create a filesystem which maintains and checks CRC information
 in all metadata objects on disk. The value is either 0 to disable the feature,
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 037246effd70..f9f78a020092 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -120,6 +120,7 @@ enum {
 	M_RMAPBT,
 	M_REFLINK,
 	M_INOBTCNT,
+	M_BIGTIME,
 	M_MAX_OPTS,
 };
 
@@ -667,6 +668,7 @@ static struct opt_params mopts = {
 		[M_RMAPBT] = "rmapbt",
 		[M_REFLINK] = "reflink",
 		[M_INOBTCNT] = "inobtcount",
+		[M_BIGTIME] = "bigtime",
 	},
 	.subopt_params = {
 		{ .index = M_CRC,
@@ -703,6 +705,12 @@ static struct opt_params mopts = {
 		  .maxval = 1,
 		  .defaultval = 1,
 		},
+		{ .index = M_BIGTIME,
+		  .conflicts = { { NULL, LAST_CONFLICT } },
+		  .minval = 0,
+		  .maxval = 1,
+		  .defaultval = 1,
+		},
 	},
 };
 
@@ -755,6 +763,7 @@ struct sb_feat_args {
 	bool	rmapbt;			/* XFS_SB_FEAT_RO_COMPAT_RMAPBT */
 	bool	reflink;		/* XFS_SB_FEAT_RO_COMPAT_REFLINK */
 	bool	inobtcnt;		/* XFS_SB_FEAT_RO_COMPAT_INOBTCNT */
+	bool	bigtime;		/* XFS_SB_FEAT_INCOMPAT_BIGTIME */
 	bool	nodalign;
 	bool	nortalign;
 };
@@ -878,7 +887,7 @@ usage( void )
 	fprintf(stderr, _("Usage: %s\n\
 /* blocksize */		[-b size=num]\n\
 /* metadata */		[-m crc=0|1,finobt=0|1,uuid=xxx,rmapbt=0|1,reflink=0|1,\n\
-			    inobtcnt=0|1]\n\
+			    inobtcnt=0|1,bigtime=0|1]\n\
 /* data subvol */	[-d agcount=n,agsize=n,file,name=xxx,size=num,\n\
 			    (sunit=value,swidth=value|su=num,sw=num|noalign),\n\
 			    sectsize=num\n\
@@ -1621,6 +1630,9 @@ meta_opts_parser(
 	case M_INOBTCNT:
 		cli->sb_feat.inobtcnt = getnum(value, opts, subopt);
 		break;
+	case M_BIGTIME:
+		cli->sb_feat.bigtime = getnum(value, opts, subopt);
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -2044,6 +2056,13 @@ _("reflink not supported without CRC support\n"));
 			usage();
 		}
 		cli->sb_feat.reflink = false;
+
+		if (cli->sb_feat.bigtime) {
+			fprintf(stderr,
+_("big timestamps not supported without CRC support\n"));
+			usage();
+		}
+		cli->sb_feat.bigtime = false;
 	}
 
 	if (!cli->sb_feat.finobt) {
@@ -3020,6 +3039,8 @@ sb_set_features(
 		sbp->sb_features_ro_compat |= XFS_SB_FEAT_RO_COMPAT_REFLINK;
 	if (fp->inobtcnt)
 		sbp->sb_features_ro_compat |= XFS_SB_FEAT_RO_COMPAT_INOBTCNT;
+	if (fp->bigtime)
+		sbp->sb_features_incompat |= XFS_SB_FEAT_INCOMPAT_BIGTIME;
 
 	/*
 	 * Sparse inode chunk support has two main inode alignment requirements.
@@ -3692,6 +3713,7 @@ main(
 			.parent_pointers = false,
 			.nodalign = false,
 			.nortalign = false,
+			.bigtime = false,
 		},
 	};
 


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

* Re: [PATCH 02/18] xfs: explicitly define inode timestamp range
  2020-08-17 22:59 ` [PATCH 02/18] xfs: explicitly define inode timestamp range Darrick J. Wong
@ 2020-08-18 14:17   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:17 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Formally define the inode timestamp ranges that existing filesystems
> support, and switch the vfs timetamp ranges to use it.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 01/18] libxfs: create a real struct timespec64
  2020-08-17 22:58 ` [PATCH 01/18] libxfs: create a real struct timespec64 Darrick J. Wong
@ 2020-08-18 14:19   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:19 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Create a real struct timespec64 that supports 64-bit seconds counts.
> The C library struct timespec doesn't support this on 32-bit
> architectures and we cannot lose the upper bits in the incore inode.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Ok.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 03/18] xfs: refactor quota expiration timer modification
  2020-08-17 22:59 ` [PATCH 03/18] xfs: refactor quota expiration timer modification Darrick J. Wong
@ 2020-08-18 14:21   ` Amir Goldstein
  2020-08-18 15:25     ` Darrick J. Wong
  0 siblings, 1 reply; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:21 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:24 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Define explicit limits on the range of quota grace period expiration
> timeouts and refactor the code that modifies the timeouts into helpers
> that clamp the values appropriately.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

There is no refactoring here, but I suppose you want to keep the commit
names aligned with kernel commits, so

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 04/18] xfs: refactor default quota grace period setting code
  2020-08-17 22:59 ` [PATCH 04/18] xfs: refactor default quota grace period setting code Darrick J. Wong
@ 2020-08-18 14:23   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:23 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Refactor the code that sets the default quota grace period into a helper
> function so that we can override the ondisk behavior later.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Same here. no refactoring, but fine.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 05/18] xfs: remove xfs_timestamp_t
  2020-08-17 22:59 ` [PATCH 05/18] xfs: remove xfs_timestamp_t Darrick J. Wong
@ 2020-08-18 14:24   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:24 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Kill this old typedef.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 06/18] xfs: move xfs_log_dinode_to_disk to the log code
  2020-08-17 22:59 ` [PATCH 06/18] xfs: move xfs_log_dinode_to_disk to the log code Darrick J. Wong
@ 2020-08-18 14:26   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:26 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Move this function to xfs_inode_item.c to match the encoding function
> that's already there.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Again. strange commit message in this context, but fine.
I can understand the need for keeping the commit subject, but maybe
commit body could be adapted to what commit actually does?

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 07/18] xfs: refactor inode timestamp coding
  2020-08-17 22:59 ` [PATCH 07/18] xfs: refactor inode timestamp coding Darrick J. Wong
@ 2020-08-18 14:28   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:28 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Refactor inode timestamp encoding and decoding into helper functions so
> that we can add extra behaviors in subsequent patches.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

ok.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 08/18] xfs: convert struct xfs_timestamp to union
  2020-08-17 22:59 ` [PATCH 08/18] xfs: convert struct xfs_timestamp to union Darrick J. Wong
@ 2020-08-18 14:29   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:29 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Convert the xfs_timestamp struct to a union so that we can overload it
> in the next patch.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

ok.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 09/18] libxfs: refactor NSEC_PER_SEC
  2020-08-17 22:59 ` [PATCH 09/18] libxfs: refactor NSEC_PER_SEC Darrick J. Wong
@ 2020-08-18 14:31   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:31 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Clean up all the open-coded and duplicate definitions of time unit
> conversion factors.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 10/18] xfs: widen ondisk timestamps to deal with y2038 problem
  2020-08-17 22:59 ` [PATCH 10/18] xfs: widen ondisk timestamps to deal with y2038 problem Darrick J. Wong
@ 2020-08-18 14:40   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:40 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:24 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Redesign the ondisk timestamps to be a simple unsigned 64-bit counter of
> nanoseconds since 14 Dec 1901 (i.e. the minimum time in the 32-bit unix
> time epoch).  This enables us to handle dates up to 2486, which solves
> the y2038 problem.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Changes look ok. Cannot say myself if other changes are missing.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 11/18] xfs: refactor quota timestamp coding
  2020-08-17 23:00 ` [PATCH 11/18] xfs: refactor quota timestamp coding Darrick J. Wong
@ 2020-08-18 14:41   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:41 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:25 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Refactor quota timestamp encoding and decoding into helper functions so
> that we can add extra behavior in the next patch.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

fine.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 13/18] xfs: enable big timestamps
  2020-08-17 23:00 ` [PATCH 13/18] xfs: enable big timestamps Darrick J. Wong
@ 2020-08-18 14:42   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:42 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Enable the big timestamp feature.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>


Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 18/18] mkfs: format bigtime filesystems
  2020-08-17 23:00 ` [PATCH 18/18] mkfs: format bigtime filesystems Darrick J. Wong
@ 2020-08-18 14:45   ` Amir Goldstein
  2020-08-18 15:34     ` Darrick J. Wong
  0 siblings, 1 reply; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:45 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Allow formatting with large timestamps.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

Other than one comment below...

> ---
>  man/man8/mkfs.xfs.8 |   16 ++++++++++++++++
>  mkfs/xfs_mkfs.c     |   24 +++++++++++++++++++++++-
>  2 files changed, 39 insertions(+), 1 deletion(-)
>
>
> diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8
> index 082f3ab6c063..7434b9f2b4cd 100644
> --- a/man/man8/mkfs.xfs.8
> +++ b/man/man8/mkfs.xfs.8
> @@ -154,6 +154,22 @@ valid
>  are:
>  .RS 1.2i
>  .TP
> +.BI bigtime= value
> +This option enables filesystems that can handle inode timestamps from December
> +1901 to July 2486, and quota timer expirations from January 1970 to July 2486.
> +The value is either 0 to disable the feature, or 1 to enable large timestamps.
> +.IP
> +If this feature is not enabled, the filesystem can only handle timestamps from
> +December 1901 to January 2038, and quota timers from January 1970 to February
> +2106.
> +.IP
> +By default,
> +.B mkfs.xfs
> +will not enable this feature.
> +If the option
> +.B \-m crc=0
> +is used, the large timestamp feature is not supported and is disabled.
> +.TP
>  .BI crc= value
>  This is used to create a filesystem which maintains and checks CRC information
>  in all metadata objects on disk. The value is either 0 to disable the feature,
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 037246effd70..f9f78a020092 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -120,6 +120,7 @@ enum {
>         M_RMAPBT,
>         M_REFLINK,
>         M_INOBTCNT,
> +       M_BIGTIME,
>         M_MAX_OPTS,
>  };
>
> @@ -667,6 +668,7 @@ static struct opt_params mopts = {
>                 [M_RMAPBT] = "rmapbt",
>                 [M_REFLINK] = "reflink",
>                 [M_INOBTCNT] = "inobtcount",
> +               [M_BIGTIME] = "bigtime",
>         },
>         .subopt_params = {
>                 { .index = M_CRC,
> @@ -703,6 +705,12 @@ static struct opt_params mopts = {
>                   .maxval = 1,
>                   .defaultval = 1,
>                 },
> +               { .index = M_BIGTIME,
> +                 .conflicts = { { NULL, LAST_CONFLICT } },
> +                 .minval = 0,
> +                 .maxval = 1,
> +                 .defaultval = 1,

                 .defaultval = 0 ?

Thanks,
Amir.

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

* Re: [PATCH 17/18] xfs_repair: support bigtime
  2020-08-17 23:00 ` [PATCH 17/18] xfs_repair: support bigtime Darrick J. Wong
@ 2020-08-18 14:58   ` Amir Goldstein
  2020-08-18 15:32     ` Darrick J. Wong
  0 siblings, 1 reply; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 14:58 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Check the bigtime iflag in relation to the fs feature set.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

and some questions below...

> ---
>  repair/dinode.c |   13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
>
> diff --git a/repair/dinode.c b/repair/dinode.c
> index ad2f672d8703..3507cd06075d 100644
> --- a/repair/dinode.c
> +++ b/repair/dinode.c
> @@ -2173,7 +2173,8 @@ check_nsec(
>         union xfs_timestamp     *t,
>         int                     *dirty)
>  {
> -       if ((dip->di_flags2 & be64_to_cpu(XFS_DIFLAG2_BIGTIME)) ||
> +       if ((dip->di_version >= 3 &&

It seems a bit strange that di_version check was added by this commit.

> +            (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_BIGTIME))) ||
>             be32_to_cpu(t->t_nsec) < NSEC_PER_SEC)
>                 return;
>
> @@ -2601,6 +2602,16 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
>                         flags2 &= ~XFS_DIFLAG2_COWEXTSIZE;
>                 }
>
> +               if ((flags2 & XFS_DIFLAG2_BIGTIME) &&
> +                   !xfs_sb_version_hasbigtime(&mp->m_sb)) {
> +                       if (!uncertain) {
> +                               do_warn(
> +       _("inode %" PRIu64 " is marked bigtime but file system does not support large timestamps\n"),
> +                                       lino);
> +                       }
> +                       flags2 &= ~XFS_DIFLAG2_BIGTIME;

Should we maybe also reset the timestamps to epoc in this case?

Thanks,
Amir.

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

* Re: [PATCH 16/18] xfs_db: add bigtime upgrade path
  2020-08-17 23:00 ` [PATCH 16/18] xfs_db: add bigtime upgrade path Darrick J. Wong
@ 2020-08-18 15:17   ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 15:17 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Enable users to upgrade their filesystems to bigtime support.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Nice!
I am going to pass on the review of the other two xfs_db patches.
Too much new code to read...

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 03/18] xfs: refactor quota expiration timer modification
  2020-08-18 14:21   ` Amir Goldstein
@ 2020-08-18 15:25     ` Darrick J. Wong
  2020-08-18 18:50       ` Amir Goldstein
  0 siblings, 1 reply; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-18 15:25 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 05:21:59PM +0300, Amir Goldstein wrote:
> On Tue, Aug 18, 2020 at 2:24 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
> >
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Define explicit limits on the range of quota grace period expiration
> > timeouts and refactor the code that modifies the timeouts into helpers
> > that clamp the values appropriately.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> There is no refactoring here, but I suppose you want to keep the commit
> names aligned with kernel commits, so

FWIW, these patches of mine where (1) 'xfs: ' is in the subject; (2) the
changes only touch things in libxfs and the bare minimum to avoid build
breakage; and (3) whose commit log don't really match the changes are
straight ports of the kernel-space patches.

I hesitate to use the libxfs-apply script for these patches (even though
Eric will do that when he's resyncing for real) because the source
commit ids will probably never match what ends up in Linus tree.

I don't know if anyone /else/ follows this convention, but in my
xfsprogs series, I try to prefix patches that change /only/ userspace
libxfs with the tag 'libxfs: ', so that reviewers can spend more time on
the patches that tag either libxfs directly or some userspace program.

That said, this is really not obvious.  I've wondered if I should amend
libxfs-apply to be able to quote the source commit subject line so that
it's more obvious when a patch is simply a userspace port.  Would that
help?

--D

> 
> Reviewed-by: Amir Goldstein <amir73il@gmail.com>

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

* Re: [PATCH 17/18] xfs_repair: support bigtime
  2020-08-18 14:58   ` Amir Goldstein
@ 2020-08-18 15:32     ` Darrick J. Wong
  0 siblings, 0 replies; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-18 15:32 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 05:58:11PM +0300, Amir Goldstein wrote:
> On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
> >
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Check the bigtime iflag in relation to the fs feature set.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Reviewed-by: Amir Goldstein <amir73il@gmail.com>
> 
> and some questions below...
> 
> > ---
> >  repair/dinode.c |   13 ++++++++++++-
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> >
> >
> > diff --git a/repair/dinode.c b/repair/dinode.c
> > index ad2f672d8703..3507cd06075d 100644
> > --- a/repair/dinode.c
> > +++ b/repair/dinode.c
> > @@ -2173,7 +2173,8 @@ check_nsec(
> >         union xfs_timestamp     *t,
> >         int                     *dirty)
> >  {
> > -       if ((dip->di_flags2 & be64_to_cpu(XFS_DIFLAG2_BIGTIME)) ||
> > +       if ((dip->di_version >= 3 &&
> 
> It seems a bit strange that di_version check was added by this commit.

Ooh, yeah.  That was added a few patches back, though it shouldn't have
been.

> > +            (dip->di_flags2 & cpu_to_be64(XFS_DIFLAG2_BIGTIME))) ||
> >             be32_to_cpu(t->t_nsec) < NSEC_PER_SEC)
> >                 return;
> >
> > @@ -2601,6 +2602,16 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
> >                         flags2 &= ~XFS_DIFLAG2_COWEXTSIZE;
> >                 }
> >
> > +               if ((flags2 & XFS_DIFLAG2_BIGTIME) &&
> > +                   !xfs_sb_version_hasbigtime(&mp->m_sb)) {
> > +                       if (!uncertain) {
> > +                               do_warn(
> > +       _("inode %" PRIu64 " is marked bigtime but file system does not support large timestamps\n"),
> > +                                       lino);
> > +                       }
> > +                       flags2 &= ~XFS_DIFLAG2_BIGTIME;
> 
> Should we maybe also reset the timestamps to epoc in this case?

Yeah, since it's possible that the timestamp would then have an invalid
nsec field once the bigtime field is cleared.  This also needs to log
something about logging "...would zero timestamps and clear flag".

Thanks for catching this. :)

--D

> 
> Thanks,
> Amir.

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

* Re: [PATCH 18/18] mkfs: format bigtime filesystems
  2020-08-18 14:45   ` Amir Goldstein
@ 2020-08-18 15:34     ` Darrick J. Wong
  0 siblings, 0 replies; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-18 15:34 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 05:45:41PM +0300, Amir Goldstein wrote:
> On Tue, Aug 18, 2020 at 2:23 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
> >
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Allow formatting with large timestamps.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Reviewed-by: Amir Goldstein <amir73il@gmail.com>
> 
> Other than one comment below...
> 
> > ---
> >  man/man8/mkfs.xfs.8 |   16 ++++++++++++++++
> >  mkfs/xfs_mkfs.c     |   24 +++++++++++++++++++++++-
> >  2 files changed, 39 insertions(+), 1 deletion(-)
> >
> >
> > diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8
> > index 082f3ab6c063..7434b9f2b4cd 100644
> > --- a/man/man8/mkfs.xfs.8
> > +++ b/man/man8/mkfs.xfs.8
> > @@ -154,6 +154,22 @@ valid
> >  are:
> >  .RS 1.2i
> >  .TP
> > +.BI bigtime= value
> > +This option enables filesystems that can handle inode timestamps from December
> > +1901 to July 2486, and quota timer expirations from January 1970 to July 2486.
> > +The value is either 0 to disable the feature, or 1 to enable large timestamps.
> > +.IP
> > +If this feature is not enabled, the filesystem can only handle timestamps from
> > +December 1901 to January 2038, and quota timers from January 1970 to February
> > +2106.
> > +.IP
> > +By default,
> > +.B mkfs.xfs
> > +will not enable this feature.
> > +If the option
> > +.B \-m crc=0
> > +is used, the large timestamp feature is not supported and is disabled.
> > +.TP
> >  .BI crc= value
> >  This is used to create a filesystem which maintains and checks CRC information
> >  in all metadata objects on disk. The value is either 0 to disable the feature,
> > diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> > index 037246effd70..f9f78a020092 100644
> > --- a/mkfs/xfs_mkfs.c
> > +++ b/mkfs/xfs_mkfs.c
> > @@ -120,6 +120,7 @@ enum {
> >         M_RMAPBT,
> >         M_REFLINK,
> >         M_INOBTCNT,
> > +       M_BIGTIME,
> >         M_MAX_OPTS,
> >  };
> >
> > @@ -667,6 +668,7 @@ static struct opt_params mopts = {
> >                 [M_RMAPBT] = "rmapbt",
> >                 [M_REFLINK] = "reflink",
> >                 [M_INOBTCNT] = "inobtcount",
> > +               [M_BIGTIME] = "bigtime",
> >         },
> >         .subopt_params = {
> >                 { .index = M_CRC,
> > @@ -703,6 +705,12 @@ static struct opt_params mopts = {
> >                   .maxval = 1,
> >                   .defaultval = 1,
> >                 },
> > +               { .index = M_BIGTIME,
> > +                 .conflicts = { { NULL, LAST_CONFLICT } },
> > +                 .minval = 0,
> > +                 .maxval = 1,
> > +                 .defaultval = 1,
> 
>                  .defaultval = 0 ?

The (somewhat misnamed) defaultval determines the implied value if the
user doesn't specify one, e.g. "-m bigtime" instead of "-m bigtime=1".
Therefore, we want it to default to 1 like all the other feature flag
arguments.

Thanks for reviewing most of this featureset! :)

--D

> 
> Thanks,
> Amir.

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

* Re: [PATCH 14/18] xfs_db: report bigtime format timestamps
  2020-08-17 23:00 ` [PATCH 14/18] xfs_db: report bigtime format timestamps Darrick J. Wong
@ 2020-08-18 15:37   ` Darrick J. Wong
  0 siblings, 0 replies; 39+ messages in thread
From: Darrick J. Wong @ 2020-08-18 15:37 UTC (permalink / raw)
  To: sandeen; +Cc: linux-xfs

On Mon, Aug 17, 2020 at 04:00:22PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Report the large format timestamps.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  db/dquot.c               |   31 +++++++++++-
>  db/field.c               |    6 ++
>  db/field.h               |    3 +
>  db/fprint.c              |  120 ++++++++++++++++++++++++++++++++++++++++++++++
>  db/fprint.h              |    6 ++
>  db/inode.c               |   28 ++++++++++-
>  db/sb.c                  |    2 +
>  libxfs/libxfs_api_defs.h |    3 +
>  8 files changed, 194 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/db/dquot.c b/db/dquot.c
> index edfcb0ca0744..30f4e6523c39 100644
> --- a/db/dquot.c
> +++ b/db/dquot.c
> @@ -44,6 +44,22 @@ const field_t	dqblk_flds[] = {
>  	{ NULL }
>  };
>  
> +static int
> +dquot_timestamp_count(
> +	void		*obj,
> +	int		startoff)
> +{
> +	return xfs_sb_version_hasbigtime(&mp->m_sb) ? 0 : 1;
> +}
> +
> +static int
> +dquot_bigtimestamp_count(
> +	void		*obj,
> +	int		startoff)
> +{
> +	return xfs_sb_version_hasbigtime(&mp->m_sb) ? 1 : 0;
> +}
> +
>  #define	DOFF(f)		bitize(offsetof(struct xfs_disk_dquot, d_ ## f))
>  const field_t	disk_dquot_flds[] = {
>  	{ "magic", FLDT_UINT16X, OI(DOFF(magic)), C1, 0, TYP_NONE },
> @@ -60,8 +76,14 @@ const field_t	disk_dquot_flds[] = {
>  	  TYP_NONE },
>  	{ "bcount", FLDT_QCNT, OI(DOFF(bcount)), C1, 0, TYP_NONE },
>  	{ "icount", FLDT_QCNT, OI(DOFF(icount)), C1, 0, TYP_NONE },
> -	{ "itimer", FLDT_INT32D, OI(DOFF(itimer)), C1, 0, TYP_NONE },
> -	{ "btimer", FLDT_INT32D, OI(DOFF(btimer)), C1, 0, TYP_NONE },
> +	{ "itimer", FLDT_INT32D, OI(DOFF(itimer)), dquot_timestamp_count,
> +	  FLD_COUNT, TYP_NONE },
> +	{ "btimer", FLDT_INT32D, OI(DOFF(btimer)), dquot_timestamp_count,
> +	  FLD_COUNT, TYP_NONE },
> +	{ "itimer", FLDT_BTQTIMER, OI(DOFF(itimer)), dquot_bigtimestamp_count,
> +	  FLD_COUNT, TYP_NONE },
> +	{ "btimer", FLDT_BTQTIMER, OI(DOFF(btimer)), dquot_bigtimestamp_count,
> +	  FLD_COUNT, TYP_NONE },
>  	{ "iwarns", FLDT_QWARNCNT, OI(DOFF(iwarns)), C1, 0, TYP_NONE },
>  	{ "bwarns", FLDT_QWARNCNT, OI(DOFF(bwarns)), C1, 0, TYP_NONE },
>  	{ "pad0", FLDT_UINT32X, OI(DOFF(pad0)), C1, FLD_SKIPALL, TYP_NONE },
> @@ -70,7 +92,10 @@ const field_t	disk_dquot_flds[] = {
>  	{ "rtb_softlimit", FLDT_QCNT, OI(DOFF(rtb_softlimit)), C1, 0,
>  	  TYP_NONE },
>  	{ "rtbcount", FLDT_QCNT, OI(DOFF(rtbcount)), C1, 0, TYP_NONE },
> -	{ "rtbtimer", FLDT_INT32D, OI(DOFF(rtbtimer)), C1, 0, TYP_NONE },
> +	{ "rtbtimer", FLDT_INT32D, OI(DOFF(rtbtimer)), dquot_timestamp_count,
> +	  FLD_COUNT, TYP_NONE },
> +	{ "rtbtimer", FLDT_BTQTIMER, OI(DOFF(rtbtimer)),
> +	  dquot_bigtimestamp_count, FLD_COUNT, TYP_NONE },
>  	{ "rtbwarns", FLDT_QWARNCNT, OI(DOFF(rtbwarns)), C1, 0, TYP_NONE },
>  	{ "pad", FLDT_UINT16X, OI(DOFF(pad)), C1, FLD_SKIPALL, TYP_NONE },
>  	{ NULL }
> diff --git a/db/field.c b/db/field.c
> index cf3002c730e6..fad17b1f082e 100644
> --- a/db/field.c
> +++ b/db/field.c
> @@ -351,6 +351,12 @@ const ftattr_t	ftattrtab[] = {
>  	  NULL, NULL },
>  	{ FLDT_TIMESTAMP, "timestamp", NULL, (char *)timestamp_flds,
>  	  SI(bitsz(union xfs_timestamp)), 0, NULL, timestamp_flds },
> +	{ FLDT_BTSEC, "btsec", fp_btsec, NULL, SI(bitsz(uint64_t)), 0, NULL,
> +	  NULL },
> +	{ FLDT_BTNSEC, "btnsec", fp_btnsec, NULL, SI(bitsz(uint64_t)), 0, NULL,
> +	  NULL },
> +	{ FLDT_BTQTIMER, "btqtimer", fp_btqtimer, NULL, SI(bitsz(uint32_t)), 0,
> +	  NULL, NULL },
>  	{ FLDT_UINT1, "uint1", fp_num, "%u", SI(1), 0, NULL, NULL },
>  	{ FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(uint16_t)), 0, NULL,
>  	  NULL },
> diff --git a/db/field.h b/db/field.h
> index 15065373de39..0d27cd085b13 100644
> --- a/db/field.h
> +++ b/db/field.h
> @@ -170,6 +170,9 @@ typedef enum fldt	{
>  
>  	FLDT_TIME,
>  	FLDT_TIMESTAMP,
> +	FLDT_BTSEC,
> +	FLDT_BTNSEC,
> +	FLDT_BTQTIMER,
>  	FLDT_UINT1,
>  	FLDT_UINT16D,
>  	FLDT_UINT16O,
> diff --git a/db/fprint.c b/db/fprint.c
> index c9d07e1bca7e..3a4f839b355d 100644
> --- a/db/fprint.c
> +++ b/db/fprint.c
> @@ -19,6 +19,7 @@
>  #include "sig.h"
>  #include "malloc.h"
>  #include "io.h"
> +#include "init.h"
>  
>  int
>  fp_charns(
> @@ -145,6 +146,125 @@ fp_time(
>  	return 1;
>  }
>  
> +static void
> +fp_timespec64(
> +	struct timespec64	*ts)
> +{
> +	BUILD_BUG_ON(sizeof(long) != sizeof(time_t));
> +
> +	if (ts->tv_sec > LONG_MAX || ts->tv_sec < LONG_MIN) {
> +		dbprintf("%lld", (long long)ts->tv_sec);
> +	} else {
> +		time_t	tt = ts->tv_sec;
> +		char	*c;
> +
> +		c = ctime(&tt);

Hmm, this really ought to fall back to the %lld printf if an error
occurs.

--D

> +		dbprintf("%24.24s", c);
> +	}
> +}
> +
> +int
> +fp_btsec(
> +	void			*obj,
> +	int			bit,
> +	int			count,
> +	char			*fmtstr,
> +	int			size,
> +	int			arg,
> +	int			base,
> +	int			array)
> +{
> +	struct timespec64	ts;
> +	union xfs_timestamp	*xts;
> +	int			bitpos;
> +	int			i;
> +
> +	ASSERT(bitoffs(bit) == 0);
> +	for (i = 0, bitpos = bit;
> +	     i < count && !seenint();
> +	     i++, bitpos += size) {
> +		if (array)
> +			dbprintf("%d:", i + base);
> +		xts = obj + byteize(bitpos);
> +		libxfs_inode_from_disk_timestamp(obj, &ts, xts);
> +		fp_timespec64(&ts);
> +		if (i < count - 1)
> +			dbprintf(" ");
> +	}
> +	return 1;
> +}
> +
> +int
> +fp_btnsec(
> +	void			*obj,
> +	int			bit,
> +	int			count,
> +	char			*fmtstr,
> +	int			size,
> +	int			arg,
> +	int			base,
> +	int			array)
> +{
> +	struct timespec64	ts;
> +	union xfs_timestamp	*xts;
> +	int			bitpos;
> +	int			i;
> +
> +	ASSERT(bitoffs(bit) == 0);
> +	for (i = 0, bitpos = bit;
> +	     i < count && !seenint();
> +	     i++, bitpos += size) {
> +		if (array)
> +			dbprintf("%d:", i + base);
> +		xts = obj + byteize(bitpos);
> +		libxfs_inode_from_disk_timestamp(obj, &ts, xts);
> +		dbprintf("%u", ts.tv_nsec);
> +		if (i < count - 1)
> +			dbprintf(" ");
> +	}
> +	return 1;
> +}
> +
> +int
> +fp_btqtimer(
> +	void			*obj,
> +	int			bit,
> +	int			count,
> +	char			*fmtstr,
> +	int			size,
> +	int			arg,
> +	int			base,
> +	int			array)
> +{
> +	struct timespec64	ts = { 0 };
> +	struct xfs_disk_dquot	*ddq = obj;
> +	__be32			*t;
> +	int			bitpos;
> +	int			i;
> +
> +	ASSERT(bitoffs(bit) == 0);
> +	for (i = 0, bitpos = bit;
> +	     i < count && !seenint();
> +	     i++, bitpos += size) {
> +		if (array)
> +			dbprintf("%d:", i + base);
> +		t = obj + byteize(bitpos);
> +		libxfs_dquot_from_disk_timestamp(ddq, &ts.tv_sec, *t);
> +
> +		/*
> +		 * Display the raw value if it's the default grace expiration
> +		 * period (root dquot) or if the quota has not expired.
> +		 */
> +		if (ddq->d_id == 0 || ts.tv_sec == 0)
> +			dbprintf("%llu", (unsigned long long)ts.tv_sec);
> +		else
> +			fp_timespec64(&ts);
> +		if (i < count - 1)
> +			dbprintf(" ");
> +	}
> +	return 1;
> +}
> +
>  /*ARGSUSED*/
>  int
>  fp_uuid(
> diff --git a/db/fprint.h b/db/fprint.h
> index c958dca0ed92..a33dcd11248d 100644
> --- a/db/fprint.h
> +++ b/db/fprint.h
> @@ -15,6 +15,12 @@ extern int	fp_sarray(void *obj, int bit, int count, char *fmtstr, int size,
>  			  int arg, int base, int array);
>  extern int	fp_time(void *obj, int bit, int count, char *fmtstr, int size,
>  			int arg, int base, int array);
> +extern int	fp_btsec(void *obj, int bit, int count, char *fmtstr, int size,
> +			int arg, int base, int array);
> +extern int	fp_btnsec(void *obj, int bit, int count, char *fmtstr, int size,
> +			int arg, int base, int array);
> +extern int	fp_btqtimer(void *obj, int bit, int count, char *fmtstr,
> +			int size, int arg, int base, int array);
>  extern int	fp_uuid(void *obj, int bit, int count, char *fmtstr, int size,
>  			int arg, int base, int array);
>  extern int	fp_crc(void *obj, int bit, int count, char *fmtstr, int size,
> diff --git a/db/inode.c b/db/inode.c
> index 25112bb5e4d8..5fbfd4ddb5f5 100644
> --- a/db/inode.c
> +++ b/db/inode.c
> @@ -175,14 +175,38 @@ const field_t	inode_v3_flds[] = {
>  	{ "dax", FLDT_UINT1,
>  	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_DAX_BIT - 1), C1,
>  	  0, TYP_NONE },
> +	{ "bigtime", FLDT_UINT1,
> +	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_BIGTIME_BIT - 1), C1,
> +	  0, TYP_NONE },
>  	{ NULL }
>  };
>  
> +static int
> +inode_timestamp_count(
> +	void		*obj,
> +	int		startoff)
> +{
> +	return xfs_sb_version_hasbigtime(&mp->m_sb) ? 0 : 1;
> +}
> +
> +static int
> +inode_bigtimestamp_count(
> +	void		*obj,
> +	int		startoff)
> +{
> +	return xfs_sb_version_hasbigtime(&mp->m_sb) ? 1 : 0;
> +}
>  
>  #define	TOFF(f)	bitize(offsetof(union xfs_timestamp, t_ ## f))
>  const field_t	timestamp_flds[] = {
> -	{ "sec", FLDT_TIME, OI(TOFF(sec)), C1, 0, TYP_NONE },
> -	{ "nsec", FLDT_NSEC, OI(TOFF(nsec)), C1, 0, TYP_NONE },
> +	{ "sec", FLDT_TIME, OI(TOFF(sec)), inode_timestamp_count, FLD_COUNT,
> +		TYP_NONE },
> +	{ "nsec", FLDT_NSEC, OI(TOFF(nsec)), inode_timestamp_count, FLD_COUNT,
> +		TYP_NONE },
> +	{ "sec", FLDT_BTSEC, OI(TOFF(bigtime)), inode_bigtimestamp_count,
> +		FLD_COUNT, TYP_NONE },
> +	{ "nsec", FLDT_BTNSEC, OI(TOFF(bigtime)), inode_bigtimestamp_count,
> +		FLD_COUNT, TYP_NONE },
>  	{ NULL }
>  };
>  
> diff --git a/db/sb.c b/db/sb.c
> index 33d9f7df49bb..c68bb9a958e7 100644
> --- a/db/sb.c
> +++ b/db/sb.c
> @@ -727,6 +727,8 @@ version_string(
>  		strcat(s, ",REFLINK");
>  	if (xfs_sb_version_hasinobtcounts(sbp))
>  		strcat(s, ",INOBTCNT");
> +	if (xfs_sb_version_hasbigtime(sbp))
> +		strcat(s, ",BIGTIME");
>  	return s;
>  }
>  
> diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h
> index 4ee02473df0d..b83dc48a4802 100644
> --- a/libxfs/libxfs_api_defs.h
> +++ b/libxfs/libxfs_api_defs.h
> @@ -116,6 +116,7 @@ struct timespec64 {
>  #define xfs_dir_replace			libxfs_dir_replace
>  
>  #define xfs_dqblk_repair		libxfs_dqblk_repair
> +#define xfs_dquot_from_disk_timestamp	libxfs_dquot_from_disk_timestamp
>  #define xfs_dquot_verify		libxfs_dquot_verify
>  
>  #define xfs_finobt_calc_reserves	libxfs_finobt_calc_reserves
> @@ -137,7 +138,9 @@ struct timespec64 {
>  #define xfs_inobt_maxrecs		libxfs_inobt_maxrecs
>  #define xfs_inobt_stage_cursor		libxfs_inobt_stage_cursor
>  #define xfs_inode_from_disk		libxfs_inode_from_disk
> +#define xfs_inode_from_disk_timestamp	libxfs_inode_from_disk_timestamp
>  #define xfs_inode_to_disk		libxfs_inode_to_disk
> +#define xfs_inode_to_disk_timestamp	libxfs_inode_to_disk_timestamp
>  #define xfs_inode_validate_cowextsize	libxfs_inode_validate_cowextsize
>  #define xfs_inode_validate_extsize	libxfs_inode_validate_extsize
>  
> 

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

* Re: [PATCH 03/18] xfs: refactor quota expiration timer modification
  2020-08-18 15:25     ` Darrick J. Wong
@ 2020-08-18 18:50       ` Amir Goldstein
  0 siblings, 0 replies; 39+ messages in thread
From: Amir Goldstein @ 2020-08-18 18:50 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, linux-xfs

On Tue, Aug 18, 2020 at 6:25 PM Darrick J. Wong <darrick.wong@oracle.com> wrote:
>
> On Tue, Aug 18, 2020 at 05:21:59PM +0300, Amir Goldstein wrote:
> > On Tue, Aug 18, 2020 at 2:24 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
> > >
> > > From: Darrick J. Wong <darrick.wong@oracle.com>
> > >
> > > Define explicit limits on the range of quota grace period expiration
> > > timeouts and refactor the code that modifies the timeouts into helpers
> > > that clamp the values appropriately.
> > >
> > > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > There is no refactoring here, but I suppose you want to keep the commit
> > names aligned with kernel commits, so
>
> FWIW, these patches of mine where (1) 'xfs: ' is in the subject; (2) the
> changes only touch things in libxfs and the bare minimum to avoid build
> breakage; and (3) whose commit log don't really match the changes are
> straight ports of the kernel-space patches.
>
> I hesitate to use the libxfs-apply script for these patches (even though
> Eric will do that when he's resyncing for real) because the source
> commit ids will probably never match what ends up in Linus tree.
>
> I don't know if anyone /else/ follows this convention, but in my
> xfsprogs series, I try to prefix patches that change /only/ userspace
> libxfs with the tag 'libxfs: ', so that reviewers can spend more time on
> the patches that tag either libxfs directly or some userspace program.
>
> That said, this is really not obvious.  I've wondered if I should amend
> libxfs-apply to be able to quote the source commit subject line so that
> it's more obvious when a patch is simply a userspace port.  Would that
> help?
>

This wasn't a problem for me when reviewing the patches.
Kernel patches were fresh in my head and I could tell when patches were
partially applied.

I think it is more of a concern for long term maintenance of xfsprogs -
having patches with obscure commit messages that do not match the
change, so it is really up to Eric and you guys as main stakeholders.

FWIW, quoting the kernel source commit sounds like a good idea.

Thanks,
Amir.

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

end of thread, other threads:[~2020-08-18 18:50 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17 22:58 [PATCH 00/18] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
2020-08-17 22:58 ` [PATCH 01/18] libxfs: create a real struct timespec64 Darrick J. Wong
2020-08-18 14:19   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 02/18] xfs: explicitly define inode timestamp range Darrick J. Wong
2020-08-18 14:17   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 03/18] xfs: refactor quota expiration timer modification Darrick J. Wong
2020-08-18 14:21   ` Amir Goldstein
2020-08-18 15:25     ` Darrick J. Wong
2020-08-18 18:50       ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 04/18] xfs: refactor default quota grace period setting code Darrick J. Wong
2020-08-18 14:23   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 05/18] xfs: remove xfs_timestamp_t Darrick J. Wong
2020-08-18 14:24   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 06/18] xfs: move xfs_log_dinode_to_disk to the log code Darrick J. Wong
2020-08-18 14:26   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 07/18] xfs: refactor inode timestamp coding Darrick J. Wong
2020-08-18 14:28   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 08/18] xfs: convert struct xfs_timestamp to union Darrick J. Wong
2020-08-18 14:29   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 09/18] libxfs: refactor NSEC_PER_SEC Darrick J. Wong
2020-08-18 14:31   ` Amir Goldstein
2020-08-17 22:59 ` [PATCH 10/18] xfs: widen ondisk timestamps to deal with y2038 problem Darrick J. Wong
2020-08-18 14:40   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 11/18] xfs: refactor quota timestamp coding Darrick J. Wong
2020-08-18 14:41   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 12/18] xfs: enable bigtime for quota timers Darrick J. Wong
2020-08-17 23:00 ` [PATCH 13/18] xfs: enable big timestamps Darrick J. Wong
2020-08-18 14:42   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 14/18] xfs_db: report bigtime format timestamps Darrick J. Wong
2020-08-18 15:37   ` Darrick J. Wong
2020-08-17 23:00 ` [PATCH 15/18] xfs_db: support printing time limits Darrick J. Wong
2020-08-17 23:00 ` [PATCH 16/18] xfs_db: add bigtime upgrade path Darrick J. Wong
2020-08-18 15:17   ` Amir Goldstein
2020-08-17 23:00 ` [PATCH 17/18] xfs_repair: support bigtime Darrick J. Wong
2020-08-18 14:58   ` Amir Goldstein
2020-08-18 15:32     ` Darrick J. Wong
2020-08-17 23:00 ` [PATCH 18/18] mkfs: format bigtime filesystems Darrick J. Wong
2020-08-18 14:45   ` Amir Goldstein
2020-08-18 15:34     ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.