Repository navigation
Backport of Fix available space accounting for special/dedup (#18222) - #18367
Merged
Merged
Conversation
behlendorf
approved these changes
Mar 25, 2026
behlendorf
left a comment
Contributor
There was a problem hiding this comment.
The change itself looks right. It seems we'll need to backport a few CI changes as well to get a proper test run.
pcd1193182
force-pushed
the
osnexus_2210
branch
2 times, most recently
from
April 6, 2026 20:01
fe1ecbc to
00f4664
Compare
…#18222) Sponsored-by: Klara, Inc. Sponsored-by: OSNexus Signed-off-by: Paul Dagnelie
pcd1193182
force-pushed
the
osnexus_2210
branch
from
April 15, 2026 18:22
00f4664 to
408ecf8
Compare
behlendorf
approved these changes
Apr 15, 2026
behlendorf
merged commit Apr 16, 2026
a78630a
into
openzfs:zfs-2.2.10-staging
25 of 27 checks passed
tonyhutter
pushed a commit
to tonyhutter/zfs
that referenced
this pull request
Jun 8, 2026
Currently, spa_dspace (base to calculate dataset AVAIL) only includes
the normal allocation class capacity, but dd_used_bytes tracks space
allocated across all classes. Since we don't want to report free
space of other classes as available (we can't promise new allocations
will be able to use it), report only allocated space, similar to how
we report space saved by dedup and block cloning.
Since we need deflated space here, make allocation classes track
deflated allocated space also. While here, make mc_deferred also
deflated, matching its use contexts. Also while there, use
atomic_load() to read the allocation class stats.
NOTE: This is a backport of this relatively small and self-contained
fix to alleviate the issue.
Sponsored-by: Klara, Inc.
Sponsored-by: OSNexus
Reviewed-by: Brian Behlendorf
Signed-off-by: Paul Dagnelie
Co-authored-by: Alexander Motin
Closes openzfs#18222
Closes openzfs#18367
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Sponsored-by: Klara, Inc.
Sponsored-by: OSNexus
Description
This is a simple backport of @amotin 's fix for issue #18190 onto 2.2. This issue can occur on production systems in these older versions, so it is probably worth backporting this relatively small and self-contained fix to alleviate the issue.
How Has This Been Tested?
Verified no regressions using the ZFS test suite and tested that it had the desired effect on systems experiencing a critical space shortage but with ample special class space.
Types of changes
Checklist:
Signed-off-by.