zhack: Fix importing large allocation profiles on small pools#18256
Merged
tonyhutter merged 1 commit intoopenzfs:masterfrom Feb 24, 2026
Merged
zhack: Fix importing large allocation profiles on small pools#18256tonyhutter merged 1 commit intoopenzfs:masterfrom
tonyhutter merged 1 commit intoopenzfs:masterfrom
Conversation
This patch fixes a segmentation fault in zhack metaslab leak which might be triggered by feeding zhack with a fragmentation profile that's exported from a pool larger than the target pool. Fixes: 8f15d2e Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: Mateusz Piotrowski <mateusz.piotrowski@klarasystems.com>
680a23c to
ebb07dc
Compare
pcd1193182
approved these changes
Feb 23, 2026
behlendorf
approved these changes
Feb 23, 2026
allanjude
pushed a commit
to KlaraSystems/zfs
that referenced
this pull request
Feb 27, 2026
…s#18256) This patch fixes a segmentation fault in zhack metaslab leak which might be triggered by feeding zhack with a fragmentation profile that's exported from a pool larger than the target pool. Fixes: 8f15d2e Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Paul Dagnelie <paul.dagnelie@klarasystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Mateusz Piotrowski <mateusz.piotrowski@klarasystems.com> (cherry picked from commit 3408332)
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.
This patch fixes a segmentation fault in zhack metaslab leak which might be triggered by feeding zhack with a fragmentation profile that's exported from a pool larger than the target pool.
Fixes: 8f15d2e
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Motivation and Context
Currently, if you export an allocation profile from pool A and you import that allocation profile into pool B, then zhack will segfault if pool A was larger than pool B. This patch fixes that.
Description
The way this fix works is that the allocation profile's allocations targeting metaslabs, which are not present in the pool, are ignored.
How Has This Been Tested?
I've tested this manually by importing the allocation profile of a larger pool into a smaller pool.
Types of changes
Checklist:
Signed-off-by.