Delay ZFS_PROP_SHARESMB property to handle it for encrypted raw receive

For encrypted raw receive, objset creation is delayed until a call to
dmu_recv_stream(). ZFS_PROP_SHARESMB property requires objset to be
populated when calling zpl_earlier_version(). To correctly handle the
ZFS_PROP_SHARESMB property for encrypted raw receive, this change
delays setting the property.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #13878
This commit is contained in:
Ameer Hamza
2022-09-21 03:19:05 +05:00
committed by GitHub
parent 3f400b0f58
commit c50b3f14d3
2 changed files with 23 additions and 0 deletions
@@ -133,6 +133,14 @@ recv_cksum=$(md5digest /$ds/$TESTFILE0)
log_must test "$recv_cksum" == "$cksum"
log_must zfs destroy -r $ds
# Test that we can override sharesmb property for encrypted raw stream.
log_note "Must be able to override sharesmb property for encrypted raw stream"
ds=$TESTPOOL/recv
log_must eval "zfs send -w $esnap > $sendfile"
log_must eval "zfs recv -o sharesmb=on $ds < $sendfile"
log_must test "$(get_prop 'sharesmb' $ds)" == "on"
log_must zfs destroy -r $ds
# Test that we can override encryption properties on a properties stream
# of an unencrypted dataset, turning it into an encryption root.
log_note "Must be able to receive stream with props as encryption root"