diff options
author | mckusick <mckusick@FreeBSD.org> | 2000-04-28 06:12:56 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2000-04-28 06:12:56 +0000 |
commit | 9ae79363c480537a31e6f8abe5707bdd74125b37 (patch) | |
tree | 7c249d81eb5267653f9cdcdb5378b78538fd86c7 | |
parent | 1d7addbc94b527672bb9e50f518b052c9e89b59e (diff) | |
download | FreeBSD-src-9ae79363c480537a31e6f8abe5707bdd74125b37.zip FreeBSD-src-9ae79363c480537a31e6f8abe5707bdd74125b37.tar.gz |
When files are given to users by root, the quota system failed to
reset their grace timer as their ownership crossed the soft limit
threshhold. Thus if they had been over their limit in the past,
they were suddenly penalized as if they had been over their limit
ever since. The fix is to check when root gives away files, that
when the receiving user crosses their soft limit, their grace timer
is reset. See the PR report for a detailed method of reproducing
the bug.
PR: kern/17128
Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Reviewed by: Kirk McKusick <mckusick@mckusick.com>
-rw-r--r-- | sys/ufs/ufs/ufs_quota.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index 1baf165..18cbcd3 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -164,6 +164,11 @@ chkdq(ip, change, cred, flags) dq->dq_flags |= DQ_WANT; (void) tsleep((caddr_t)dq, PINOD+1, "chkdq2", 0); } + /* Reset timer when crossing soft limit */ + if (dq->dq_curblocks + change >= dq->dq_bsoftlimit && + dq->dq_curblocks < dq->dq_bsoftlimit) + dq->dq_btime = time_second + + VFSTOUFS(ITOV(ip)->v_mount)->um_btime[i]; dq->dq_curblocks += change; dq->dq_flags |= DQ_MOD; } @@ -280,6 +285,11 @@ chkiq(ip, change, cred, flags) dq->dq_flags |= DQ_WANT; (void) tsleep((caddr_t)dq, PINOD+1, "chkiq2", 0); } + /* Reset timer when crossing soft limit */ + if (dq->dq_curinodes + change >= dq->dq_isoftlimit && + dq->dq_curinodes < dq->dq_isoftlimit) + dq->dq_itime = time_second + + VFSTOUFS(ITOV(ip)->v_mount)->um_itime[i]; dq->dq_curinodes += change; dq->dq_flags |= DQ_MOD; } |