Skip to content

Restrict cloning with different properties#18180

Open
amotin wants to merge 1 commit intoopenzfs:masterfrom
amotin:clone_strict
Open

Restrict cloning with different properties#18180
amotin wants to merge 1 commit intoopenzfs:masterfrom
amotin:clone_strict

Conversation

@amotin
Copy link
Member

@amotin amotin commented Feb 5, 2026

While technically its not a problem to clone between datasets with different properties, it might create expectation of new properties being applied during data move, while actually it won't happen. For copies and checksum it may mean incorrect safety expectations. For dedup, compression and special_small_blocks -- performance and space usage. New zfs_bclone_strict_properties tunable controls it.

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:

Copy link
Member

@robn robn left a comment

Choose a reason for hiding this comment

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

Yeah, that's fair. I had thought about arguing to disallow it only if the result would be worse (eg source has higher copies= than dest), especially after seeing that its strict by default. But I'm not going to, because this is a small and easy-to-understand change, chooses safety every time, and for most people probably won't come up anyway. Works for me!

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

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

Yes, I'm good with this. However, instead of removing the block_diff* tests let's use this as an opportunity to test that the new option works by setting zfs_bclone_strict_properties=0 for these tests.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Feb 6, 2026
While technically its not a problem to clone between datasets with
different properties, it might create expectation of new properties
being applied during data move, while actually it won't happen.
For copies and checksum it may mean incorrect safety expectations.
For dedup, compression and special_small_blocks -- performance and
space usage. New zfs_bclone_strict_properties tunable controls it.

Signed-off-by: Alexander Motin <[email protected]>
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.

3 participants