Re-initialize objsets when feature@project_quota is enabled #17999
+96
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
When upgrading from an older version of ZFS which does not have project quotas to a version of OpenZFS which does, after a zpool upgrade, the feature remains enabled but not active and project operations fail with
ENOTSUP, rendering it unusable until a given objset is re-opened.This was observed with an upgrade from ZoL 0.7.1 to OpenZFS 2.3.
Fixes #17955
Description
dmu_objset_open_impl(), if project quotas are present on the pool, a dnode is allocated to hold/refer to the projectused ZAP object and assigned to an in-memory objset fieldos_projectused_dnode.os_projectused_dnodeis used to decide whether project quotas are enabled for a given objset.os_projectused_dnode == NULL. For this reasondmu_objset_projectquota_enabled()will always be false, and actual upgrade will not happen until the objset is re-opened.It seems like a similar issue has been happening with user quotas back in the day and the solution was to suspend and resume the affected file systems in order to re-initialize the affected object sets (see
zfs_prop_set_special()→zfs_ioc_userspace_upgrade()). So analogously, we suspend+resume all the pool's affected file systems to re-initialize their associated object sets whenfeature@project_quotais set andos_projectused_dnodeisNULL.How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by.