Blame SOURCES/xfsprogs-5.10.0-xfs-refactor-quota-expiration-timer-modification.patch

5d5cbe
From 94c5482a7e0cbb6fd289745a4b5f49a133a4f5e8 Mon Sep 17 00:00:00 2001
5d5cbe
From: "Darrick J. Wong" <darrick.wong@oracle.com>
5d5cbe
Date: Tue, 10 Nov 2020 15:11:09 -0500
5d5cbe
Subject: [PATCH] xfs: refactor quota expiration timer modification
5d5cbe
5d5cbe
Source kernel commit: 11d8a9190275855f79d62093d789e962cc7228fb
5d5cbe
5d5cbe
Define explicit limits on the range of quota grace period expiration
5d5cbe
timeouts and refactor the code that modifies the timeouts into helpers
5d5cbe
that clamp the values appropriately.  Note that we'll refactor the
5d5cbe
default grace period timer separately.
5d5cbe
5d5cbe
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
5d5cbe
Reviewed-by: Christoph Hellwig <hch@lst.de>
5d5cbe
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
5d5cbe
Reviewed-by: Dave Chinner <dchinner@redhat.com>
5d5cbe
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
5d5cbe
---
5d5cbe
5d5cbe
diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
5d5cbe
index 5712aa0..c67bd61 100644
5d5cbe
--- a/libxfs/xfs_format.h
5d5cbe
+++ b/libxfs/xfs_format.h
5d5cbe
@@ -1180,6 +1180,30 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
5d5cbe
 #define XFS_DQUOT_MAGIC		0x4451		/* 'DQ' */
5d5cbe
 #define XFS_DQUOT_VERSION	(uint8_t)0x01	/* latest version number */
5d5cbe
 
5d5cbe
+/*
5d5cbe
+ * XFS Quota Timers
5d5cbe
+ * ================
5d5cbe
+ *
5d5cbe
+ * Traditional quota grace period expiration timers are an unsigned 32-bit
5d5cbe
+ * seconds counter; time zero is the Unix epoch, Jan  1 00:00:01 UTC 1970.
5d5cbe
+ * Note that an expiration value of zero means that the quota limit has not
5d5cbe
+ * been reached, and therefore no expiration has been set.  Therefore, the
5d5cbe
+ * ondisk min and max defined here can be used directly to constrain the incore
5d5cbe
+ * quota expiration timestamps on a Unix system.
5d5cbe
+ */
5d5cbe
+
5d5cbe
+/*
5d5cbe
+ * Smallest possible ondisk quota expiration value with traditional timestamps.
5d5cbe
+ * This corresponds exactly with the incore expiration Jan  1 00:00:01 UTC 1970.
5d5cbe
+ */
5d5cbe
+#define XFS_DQ_LEGACY_EXPIRY_MIN	((int64_t)1)
5d5cbe
+
5d5cbe
+/*
5d5cbe
+ * Largest possible ondisk quota expiration value with traditional timestamps.
5d5cbe
+ * This corresponds exactly with the incore expiration Feb  7 06:28:15 UTC 2106.
5d5cbe
+ */
5d5cbe
+#define XFS_DQ_LEGACY_EXPIRY_MAX	((int64_t)U32_MAX)
5d5cbe
+
5d5cbe
 /*
5d5cbe
  * This is the main portion of the on-disk representation of quota
5d5cbe
  * information for a user. This is the q_core of the xfs_dquot_t that