HomeFreeBSD

Fix encryption hierarchy issues with zfs recv -d

Description

Fix encryption hierarchy issues with zfs recv -d

Currently, the recv_fix_encryption_hierarchy() function accepts
'destsnap' as one of its parameters. Originally, this was intended
to be the top-level dataset of a receive (whether or not the
receive was recursive). Unfortunately, this parameter actually is
simply the input that is passed in from the command line. When
the user specifies 'zfs recv -d', this string is actually only the
name of the receiving pool since the rest of the name is derived
from the send stream. This causes the function to fail, leaving
some datasets with an invalid encryption hierarchy.

This patch resolves this problem by passing in the top_zfs variable
instead. In order to make this work, this patch also includes some
changes that ensure the value is always present when we need it.

Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #9273
Closes #9309

Details

Provenance
Tom Caputi <tcaputi@datto.com>Authored on Sep 26 2019, 12:02 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 26 2019, 12:02 AM
Parents
rG479d7d3ca6c6: ZTS: Fix typos in zfs_destroy tests cleanup
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGbb61cc318510: Fix encryption hierarchy issues with zfs recv -d (authored by Tom Caputi <tcaputi@datto.com>).Sep 26 2019, 12:02 AM