From 4bf474be2da142b07a222b2328222f1a0bceff3b Mon Sep 17 00:00:00 2001 From: Tom Caputi Date: Tue, 9 Jan 2018 14:14:41 +0900 Subject: [PATCH] Fix encryption root hierarchy issue After doing a recursive raw receive, zfs userspace performs a final pass to adjust the encryption root hierarchy as needed. Unfortunately, the FORCE_INHERIT ioctl had a bug which caused the encryption root to always be assigned to the direct parent instead of the inheriting parent. This patch simply fixes this issue Reviewed-by: Brian Behlendorf Reviewed-by: Alek Pinchuk Signed-off-by: Tom Caputi Closes ZOL # 6847 Closes ZOL # 6848 --- usr/src/uts/common/fs/zfs/dsl_crypt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/src/uts/common/fs/zfs/dsl_crypt.c b/usr/src/uts/common/fs/zfs/dsl_crypt.c index feda4d78e6b5..238fc1e16bf5 100644 --- a/usr/src/uts/common/fs/zfs/dsl_crypt.c +++ b/usr/src/uts/common/fs/zfs/dsl_crypt.c @@ -1448,7 +1448,8 @@ spa_keystore_change_key_sync(void *arg, dmu_tx_t *tx) 0, 0, NULL, tx); rddobj = ds->ds_dir->dd_object; - new_rddobj = ds->ds_dir->dd_parent->dd_object; + VERIFY0(dsl_dir_get_encryption_root_ddobj(ds->ds_dir->dd_parent, + &new_rddobj)); } if (wkey == NULL) {