xfs: widen ondisk quota expiration timestamps to handle y2038+
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> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Allison Collins <allison.henderson@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
@ -223,6 +223,8 @@ xfs_qm_init_dquot_blk(
|
||||
d->dd_diskdq.d_version = XFS_DQUOT_VERSION;
|
||||
d->dd_diskdq.d_id = cpu_to_be32(curid);
|
||||
d->dd_diskdq.d_type = type;
|
||||
if (curid > 0 && xfs_sb_version_hasbigtime(&mp->m_sb))
|
||||
d->dd_diskdq.d_type |= XFS_DQTYPE_BIGTIME;
|
||||
if (xfs_sb_version_hascrc(&mp->m_sb)) {
|
||||
uuid_copy(&d->dd_uuid, &mp->m_sb.sb_meta_uuid);
|
||||
xfs_update_cksum((char *)d, sizeof(struct xfs_dqblk),
|
||||
@ -1179,6 +1181,14 @@ xfs_qm_dqflush_check(
|
||||
!dqp->q_rtb.timer)
|
||||
return __this_address;
|
||||
|
||||
/* bigtime flag should never be set on root dquots */
|
||||
if (dqp->q_type & XFS_DQTYPE_BIGTIME) {
|
||||
if (!xfs_sb_version_hasbigtime(&dqp->q_mount->m_sb))
|
||||
return __this_address;
|
||||
if (dqp->q_id == 0)
|
||||
return __this_address;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user