Skip to content

Add an option to send datasets with params without preserving encryption#18240

Open
Idefix2020 wants to merge 1 commit intoopenzfs:masterfrom
Idefix2020:master
Open

Add an option to send datasets with params without preserving encryption#18240
Idefix2020 wants to merge 1 commit intoopenzfs:masterfrom
Idefix2020:master

Conversation

@Idefix2020
Copy link

@Idefix2020 Idefix2020 commented Feb 19, 2026

Motivation and Context

Previously it was not possible to send an encrypted dataset with parameters (e.g. -R or -p). This is because the user would usually expect all parameters (including encryption) to be preserved when using the -R or -p flags. For this reason the --raw flag was required on sending with -R or -p to prevent accidentally unencrypting a dataset by sending it to a target without encryption.
Fixes #10507

Description

This PR introduces the --no-preserve-encryption/-U flag to the zfs send command, for if the user explicitly wants to send a dataset without preserving encryption. This prevents anyone from removing encryption on a dataset on accident. Additionally a warning is emmited on sending a previously encrypted dataset without preserving encryption. The idea for an additional flag originally came from #10507.

How Has This Been Tested?

Tested sending encrypted datasets with -R and -p. Sending a dataset now works without --raw if --no-preserve-encryption is specified.

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

Thanks for tackling this much requested bit of functionality. Adding an explicit option to send the dataset unencrypted is a nice way to handle this and enable the use cases discussed in #10507. The PR itself looks reasonable, but it's going to need a test case added to make sure this new option is working properly. Can you add a test case along with the others in tests/zfs-tests/tests/functional/rsend/.

@Idefix2020
Copy link
Author

@bbehlendorf Thanks for taking a look at this. I’ll add a test case as soon as possible.

* Add an option to send datasets with params or replicate
without preserving encryption
* Add a test case for the new functionality

Signed-off-by: Chris Jacobs <idefix2020dev@gmail.com>
@Idefix2020
Copy link
Author

@behlendorf I've added the relevant test case. It looks to be working for me.

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.

zfs send -R (non-raw) of encrypted dataset does not work

2 participants