]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/zfs/dsl_crypt.c
Check encrypted dataset + embedded recv earlier
[mirror_zfs.git] / module / zfs / dsl_crypt.c
index 38e6123d32d30cd11576616586e5dfb5d894d4ed..f0878c934771bf4df8a0b21a3a35734957ed4a6e 100644 (file)
@@ -1715,12 +1715,16 @@ dmu_objset_clone_crypt_check(dsl_dir_t *parentdd, dsl_dir_t *origindd)
 
 
 int
-dmu_objset_create_crypt_check(dsl_dir_t *parentdd, dsl_crypto_params_t *dcp)
+dmu_objset_create_crypt_check(dsl_dir_t *parentdd, dsl_crypto_params_t *dcp,
+    boolean_t *will_encrypt)
 {
        int ret;
        uint64_t pcrypt, crypt;
        dsl_crypto_params_t dummy_dcp = { 0 };
 
+       if (will_encrypt != NULL)
+               *will_encrypt = B_FALSE;
+
        if (dcp == NULL)
                dcp = &dummy_dcp;
 
@@ -1758,10 +1762,13 @@ dmu_objset_create_crypt_check(dsl_dir_t *parentdd, dsl_crypto_params_t *dcp)
                return (0);
        }
 
+       if (will_encrypt != NULL)
+               *will_encrypt = B_TRUE;
+
        /*
         * We will now definitely be encrypting. Check the feature flag. When
         * creating the pool the caller will check this for us since we won't
-        * technically have the fetaure activated yet.
+        * technically have the feature activated yet.
         */
        if (parentdd != NULL &&
            !spa_feature_is_enabled(parentdd->dd_pool->dp_spa,