Bug 274552 - Setting soft quota grace time has no effect, stays at default 7 days.
Summary: Setting soft quota grace time has no effect, stays at default 7 days.
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.2-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Konstantin Belousov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-18 07:29 UTC by Mikel Lechner
Modified: 2023-10-28 22:36 UTC (History)
4 users (show)

See Also:


Attachments
Clear QTF_CLOSING flag before call to dqget() in quotaon(). (1.26 KB, text/plain)
2023-10-18 07:29 UTC, Mikel Lechner
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikel Lechner 2023-10-18 07:29:06 UTC
Created attachment 245708 [details]
Clear QTF_CLOSING flag before call to dqget() in quotaon().

Setting soft quota time limits with "edquota -t" has no effect on the quota system. The settings are stored in the quota.user file, but the soft quota grace period is unchanged at 7 days. I found the problem in "ufs/ufs/ufs_quota.c" where it attempts to load the quota record for id == 0 to set the value in ump->um_quotas[], but fails to load that quota record due to flags set in ump->um_qflags. A fix for the problem is included as an attached diff that moves the clearing of the QTF_CLOSING flag a few lines earlier to allow call to dqget() to work.
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2023-10-20 19:19:48 UTC
Konstantin, this looks like a regression from commit 088ffd20860de: the dqget() call unconditionally fails if QTF_CLOSING is set, so the patch makes some sense to me.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-10-21 06:10:45 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2fee3974603bce6f2dc153eb6af459cb4f864ab4

commit 2fee3974603bce6f2dc153eb6af459cb4f864ab4
Author:     Mikel Lechner <mikel@svpal.org>
AuthorDate: 2023-10-21 06:08:38 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-10-21 06:08:38 +0000

    ufs quotas: fix configuring soft quota grace time

    The QTF_CLOSING flag needs to be cleared earlier to allow dqget() to
    work.

    PR:     274552
    MFC after:      1 week

 sys/ufs/ufs/ufs_quota.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-10-28 04:45:25 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=6ce903e8a8a78cea2b8ff269c5accbf5529e3045

commit 6ce903e8a8a78cea2b8ff269c5accbf5529e3045
Author:     Mikel Lechner <mikel@svpal.org>
AuthorDate: 2023-10-21 06:08:38 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-10-28 04:44:44 +0000

    ufs quotas: fix configuring soft quota grace time

    PR:     274552

    (cherry picked from commit 2fee3974603bce6f2dc153eb6af459cb4f864ab4)

 sys/ufs/ufs/ufs_quota.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)