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

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