aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2019-07-15 16:08:42 -0700
committerBrian Behlendorf <[email protected]>2019-07-15 16:08:42 -0700
commit9949b856a0435d064afd7d1d929d55e5572b0831 (patch)
tree420ec020a10a6de3397e6f5a45aa0c6ecfd1c76b
parentff9630d1a8006c7a6afac4386378324e4bc94ae4 (diff)
Ensure dsl_destroy_head() decrypts objsets
This patch corrects a small issue where the dsl_destroy_head() code that runs when the async_destroy feature is disabled would not properly decrypt the dataset before beginning processing. If the dataset is not able to be decrypted, the optimization code now simply does not run and the dataset is completely destroyed in the DSL sync task. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Closes #9021
-rw-r--r--module/zfs/dsl_destroy.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/module/zfs/dsl_destroy.c b/module/zfs/dsl_destroy.c
index d15c446c7..2f98e87ed 100644
--- a/module/zfs/dsl_destroy.c
+++ b/module/zfs/dsl_destroy.c
@@ -1105,9 +1105,10 @@ dsl_destroy_head(const char *name)
/*
* Head deletion is processed in one txg on old pools;
* remove the objects from open context so that the txg sync
- * is not too long.
+ * is not too long. This optimization can only work for
+ * encrypted datasets if the wrapping key is loaded.
*/
- error = dmu_objset_own(name, DMU_OST_ANY, B_FALSE, B_FALSE,
+ error = dmu_objset_own(name, DMU_OST_ANY, B_FALSE, B_TRUE,
FTAG, &os);
if (error == 0) {
uint64_t prev_snap_txg =
@@ -1119,7 +1120,7 @@ dsl_destroy_head(const char *name)
(void) dmu_free_long_object(os, obj);
/* sync out all frees */
txg_wait_synced(dmu_objset_pool(os), 0);
- dmu_objset_disown(os, B_FALSE, FTAG);
+ dmu_objset_disown(os, B_TRUE, FTAG);
}
}