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

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