-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement default user/group/project quotas including object quotas #17130
base: master
Are you sure you want to change the base?
Conversation
824f8e8
to
1a5b6e9
Compare
@ixhamza sorry I've dropped the ball on reviewing this. I'll take a look at it this week. |
I did a test where I set
It appears that if you delete a file, it doesn't adjust your quota until a few seconds later when the TXG finishes. The 150MB quota I set was exceeded in all my test runs: Setting a defaultuserquota=1M was also exceeded: So quotas seem to be best effort rather than 100% strict, which is probably fine. Setting defaultuserquota=0 seemed to disable quotas. This should be documented in the man pages. Setting copies=2 was correctly accounted for in the quota. 👍 Writing huge xattrs to lots of zero byte files was correctly accounted for in the quota. 👍 |
Yeah, I observed similar behaviour for non-default user quotas as well. |
This adds default userquota, groupquota, and projectquota properties to MASTER_NODE_OBJ to make them accessible during zfsvfs_init() (regular DSL properties require dsl_config_lock, which cannot be safely acquired in this context). The zfs_fill_zplprops_impl() logic is updated to read these default properties directly from MASTER_NODE_OBJ. Signed-off-by: Ameer Hamza <[email protected]>
Update zfs_id_overobjquota() and zfs_id_overblockquota() to enforce default user/group/project quotas (block and object-based) when no per-user, per-group, or per-project quota exists. If a specific quota is not configured for an ID, the default quota value is applied. Signed-off-by: Ameer Hamza <[email protected]>
Ensure default user/group/project quotas are visible through quota tools and filesystem stats when no per-ID quota is configured. This maintains consistency between quota visibility and configured defaults. Signed-off-by: Ameer Hamza <[email protected]>
Update zfs userspace, groupspace, and projectspace to display the default quotas when no per-ID specific quota is configured. This ensures tool outputs align with enforced limits. Signed-off-by: Ameer Hamza <[email protected]>
Signed-off-by: Ameer Hamza <[email protected]>
Extend test coverage to verify default user and group quota functionality. These build on existing user/group quota tests with additional cases specific to default quotas functionality. Added on top of: openzfs@e08cd97 Signed-off-by: Todd Seidelmann <[email protected]> Signed-off-by: Ameer Hamza <[email protected]>
Extend project quota test coverage to verify defaultprojectquota behavior. These build on existing project quota tests with additional cases specific to defaultprojectquota functionality. Signed-off-by: Ameer Hamza <[email protected]>
Signed-off-by: Ameer Hamza <[email protected]>
Motivation and Context
This change implements default quotas for users, groups, and projects (including object quotas) by extending concepts from Solaris' Default Quotas feature. These defaults guarantee consistent quota enforcement when no per-ID limits are set while ensuring compatibility with existing tools and workflows. This PR is inspired by enhancements proposed in PR #16283.
Fixes: #5431.
Description
This change adds default quota properties to
MASTER_NODE_OBJ
, similar to per-ID specific quotas. The functionszfs_id_overobjquota()
andzfs_id_overblockquota()
have been updated to enforce default limits when no specific per-ID quotas are set. Kernel interfaces for FreeBSD (user/group quotas) and Linux (project quotas) now reflect default quotas to maintain consistency between visibility and configured limits. Thezfs userspace
,zfs groupspace
, andzfs projectspace
commands display default quotas when no per-ID quotas exist. Newly added tests take motivation from existing per-ID quota tests.How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.