From 522883b87f262bcc9ab4094f69104550da10032e Mon Sep 17 00:00:00 2001 From: Mike Pritchard Date: Sun, 4 Feb 2007 06:46:57 +0000 Subject: [PATCH] If quotacheck or edquota reset the block or inode grace time for a user or group, when the kernel first sees this, it will update the grace time value. However, it never flags the quota as modified and the updated value never makes it to the quota data file unless the user actually makes some other change that would write the data out. Fixed to flag the quota as modified if the soft limit has actually been reached and should be now enforced. --- sys/ufs/ufs/ufs_quota.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index d86e26e8c77..7d46f966029 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -987,10 +987,18 @@ dqget(vp, id, ump, type, dqp) dq->dq_ihardlimit == 0 && dq->dq_bhardlimit == 0) dq->dq_flags |= DQ_FAKE; if (dq->dq_id != 0) { - if (dq->dq_btime == 0) + if (dq->dq_btime == 0) { dq->dq_btime = time_second + ump->um_btime[type]; - if (dq->dq_itime == 0) + if (dq->dq_bsoftlimit && + dq->dq_curblocks >= dq->dq_bsoftlimit) + dq->dq_flags |= DQ_MOD; + } + if (dq->dq_itime == 0) { dq->dq_itime = time_second + ump->um_itime[type]; + if (dq->dq_isoftlimit && + dq->dq_curinodes >= dq->dq_isoftlimit) + dq->dq_flags |= DQ_MOD; + } } *dqp = dq; return (0);