Skip to content

Backport of Fix available space accounting for special/dedup (#18222) - #18367

Merged
behlendorf merged 1 commit into
openzfs:zfs-2.2.10-stagingfrom
pcd1193182:osnexus_2210
Apr 16, 2026
Merged

behlendorf merged 1 commit into
openzfs:zfs-2.2.10-stagingfrom
pcd1193182:osnexus_2210

Conversation

@pcd1193182

Copy link
Copy Markdown
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@behlendorf behlendorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
pcd1193182 force-pushed the osnexus_2210 branch 2 times, most recently from fe1ecbc to 00f4664 Compare April 6, 2026 20:01
…#18222)

Sponsored-by: Klara, Inc.
Sponsored-by: OSNexus
Signed-off-by: Paul Dagnelie 
@behlendorf
behlendorf merged commit a78630a into openzfs:zfs-2.2.10-staging Apr 16, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants