Skip to content

Fix activating large_microzap on receive - #18144

Merged
behlendorf merged 1 commit into
openzfs:masterfrom
AustinWise:austin/large-microzap
Feb 5, 2026
Merged

behlendorf merged 1 commit into
openzfs:masterfrom
AustinWise:austin/large-microzap

Conversation

@AustinWise

@AustinWise AustinWise commented Jan 19, 2026 •

Copy link
Copy Markdown
Contributor

Motivation and Context

Fixes #18143.

Description

When receiving a stream with the large microzap feature flag, the feature activation was not correctly recorded in two different ways:

  • The in-memory state of the feature activation is not captured.
  • dsl_dataset_activate_feature may be called when the feature is already recorded as active, causing a panic.

This PR fixes both problems.

How Has This Been Tested?

Two tests that fail on the master branch but pass with this PR.

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:

@AustinWise

Copy link
Copy Markdown
Contributor Author

It looks like the call earlier in dmu_recv_begin_sync to dsl_dataset_activate_redaction could suffer from a similar issue: it does not check if the feature is already active before attempting to activate. I don't know enough about redacted datasets to write a test though.

@AustinWise
AustinWise force-pushed the austin/large-microzap branch from acc509d to c9ea6c9 Compare January 19, 2026 19:46
@AustinWise AustinWise changed the title Austin/large microzap Fix activating large_microzap on receive Jan 21, 2026
@AustinWise
AustinWise marked this pull request as ready for review January 21, 2026 16:18
@github-actions github-actions Bot added Status: Code Review Needed Ready for review and testing and removed Status: Work in Progress labels Jan 21, 2026
Comment thread tests/runfiles/linux.run Resolved
@AustinWise
AustinWise marked this pull request as draft January 23, 2026 16:35
@github-actions github-actions Bot added Status: Work in Progress and removed Status: Code Review Needed Ready for review and testing labels Jan 23, 2026
@AustinWise
AustinWise force-pushed the austin/large-microzap branch 3 times, most recently from 72a537f to 8568dce Compare January 25, 2026 18:31
This ensures that the in-memory state of the feature is recorded and
that `dsl_dataset_activate_feature` is not called when the feature
is already active.

Signed-off-by: Austin Wise <AustinWise@gmail.com>
@AustinWise
AustinWise force-pushed the austin/large-microzap branch from 8568dce to c72ddf1 Compare January 25, 2026 21:52
@AustinWise
AustinWise marked this pull request as ready for review January 26, 2026 05:21
@github-actions github-actions Bot added Status: Code Review Needed Ready for review and testing and removed Status: Work in Progress labels Jan 26, 2026

@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.

Looks good. Thanks for running this down and putting together new test cases for it!

@behlendorf
behlendorf merged commit 4f180e0 into openzfs:master Feb 5, 2026
37 of 46 checks passed
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Feb 17, 2026
This ensures that the in-memory state of the feature is recorded and
that `dsl_dataset_activate_feature` is not called when the feature
is already active.

Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Austin Wise <AustinWise@gmail.com>
Closes openzfs#18143
Closes openzfs#18144
lundman pushed a commit to openzfsonosx/openzfs-fork that referenced this pull request Jul 30, 2026
This ensures that the in-memory state of the feature is recorded and
that `dsl_dataset_activate_feature` is not called when the feature
is already active.

Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Austin Wise <AustinWise@gmail.com>
Closes openzfs#18143
Closes openzfs#18144
snajpa pushed a commit to vpsfreecz/zfs that referenced this pull request Aug 5, 2026
This ensures that the in-memory state of the feature is recorded and
that `dsl_dataset_activate_feature` is not called when the feature
is already active.

Porting notes: The dmu_recv.c implementation and both focused receive
  tests are unchanged from upstream.  OpenZFS 2.3.8 does not yet have
  the adjacent DIO_STRICT tunable entry, so ZAP_MICRO_MAX_SIZE is placed
  after XATTR_COMPAT in the available tunables.cfg sequence.

Patch development history:
- v1: Upstream recorded large_microzap activation in receive state and
  added incremental and transitive receive coverage.
- v2: Adapted only the tunables.cfg insertion context to the 2.3.8 list
  and documented the unchanged source and test implementation and
  validation.

Validation: git diff --check, targeted cstyle for dmu_recv.c, and ksh
  syntax checks for both focused receive tests passed.  Changed
  implementation and test lines were compared with upstream; only
  tunables.cfg placement differs.  No build or ZTS was run.

Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Austin Wise <AustinWise@gmail.com>
Closes openzfs#18143
Closes openzfs#18144
Upstream: 4f180e0
Ported-by: Pavel Snajdr <snajpa@snajpa.net>
pull Bot pushed a commit to A-Archives-and-Forks/openzfs that referenced this pull request Sep 26, 2026
This ensures that the in-memory state of the feature is recorded and
that `dsl_dataset_activate_feature` is not called when the feature
is already active.

Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Austin Wise <AustinWise@gmail.com>
Closes openzfs#18143
Closes openzfs#18144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Code Review Needed Ready for review and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recieving a stream with the large microzap feature flag is not properly recorded

3 participants