HomeFreeBSD

Receive checks should allow unencrypted child datasets

Description

Receive checks should allow unencrypted child datasets

dmu_recv_begin_check() unconditionally sets the DS_HOLD_FLAG_DECRYPT
flag before calling dsl_dataset_hold_flags(). If the key on the
receiving side isn't loaded or the send stream contains embedded
blocks, the receive check fails for a stream which is perfectly
valid and could be received without any problem. This seems like
a remnant of the initial design, where unencrypted datasets below
encrypted ones weren't allowed.

Add a condition to set DS_HOLD_FLAG_DECRYPT only for encrypted
datasets, modify an existing test to detect this regression and add
a test for raw replication streams.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Co-authored-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #13033
Closes #13076

Details

Provenance
Attila Fülöp <attila@fueloep.org>Authored on Feb 9 2022, 10:38 PM
GitHub <noreply@github.com>Committed on Feb 9 2022, 10:38 PM
Parents
rGc28d6ab08b9e: Rename EMPTY_TASKQ into taskq_empty
Branches
Unknown
Tags
Unknown