summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2017-11-08 18:25:30 -0500
committerBrian Behlendorf <[email protected]>2017-11-08 15:25:30 -0800
commit62df1bc813e6972130fffa91c6999a8e5ef80afd (patch)
tree40ca0d5623ca01eac108c4f839051f58f583e76e
parent71a24c3c52f6223f54e6351b57e089791aa3b2f1 (diff)
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 <[email protected]> Reviewed-by: Alek Pinchuk <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Closes #6847 Closes #6848
-rw-r--r--module/zfs/dsl_crypt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/dsl_crypt.c b/module/zfs/dsl_crypt.c
index a71142682..59562d194 100644
--- a/module/zfs/dsl_crypt.c
+++ b/module/zfs/dsl_crypt.c
@@ -1454,7 +1454,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) {